öncelikle server browserdan sürükler bırakırsın çat diye oluşur insert ve inserted eventlerini yakalarsan mssql de son insert ettiğin id yi ala bilirsin .
protected void SqlDataSource1_Inserted(object sender, SqlDataSourceStatusEventArgs e)
{
int _inserted_maintemplate_id = Convert.ToInt32(((IDbDataParameter)e.Command.Parameters["@NewID"]).Value);
}
protected void SqlDataSource1_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
((IDbDataParameter)e.Command.Parameters["@NewID"]).Size = 4;
}
asp:parameter type="String" name="NewID" direction="Output"
bu son parametreyide eklemeyi unutma ama table da değişiklik yapıp insert dersen ve sql i değiştirmediysen anlamsız exception veriyor. table değişirse sqlini değiştirmeyi unuma.
Subscribe to:
Post Comments (Atom)
C# scan cs file and find variables values and names
using Microsoft . CodeAnalysis ; using Microsoft . CodeAnalysis . CSharp ; using Microsoft . CodeAnalysis . CSharp . Syntax ; using Xunit . ...
-
Yeni nesil hacker'lar: Edwin Pena | Olympos Security koptum okuyunca yazılımcılar ve pazarlamacılar bu kadar kısa ve özlü bir hikayeyle ...
-
https://leetcode.com/problems/odd-string-difference/ Beats 19.92% of users with Java class Solution { public String oddString ( S...
-
at the end of any product there will be a reporting interfaces for counts. let say you build a advertisement site which gives people to publ...
No comments:
Post a Comment