ö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)
-
After iphone 16 I wanted to test an android and looks like sony xperia 10 VI is nice, which is 6.1 inches, but it was narrow and longer than...
-
I took the first jab in August 15 around 10:30 in the morning. no pain or nausea or dry mouth, I have been intermittent fasting since 2017 ...
-
I haven't eaten around 67 hours and I am feeling pretty good, like I said after 48 hours I started another 48 hours of fast and come thi...
No comments:
Post a Comment