Sir,
i am generating value in sql using identity. this value i want to display in my application in Text box or label. how to display this value in TextBox or Label.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted Apr 2, 2012, 10:24 AM
Gohil JayendrasinhPosted Apr 2, 2012, 8:24 AM
using LINQ
MyBDDDataContext db = new MyBDDDataContext();
record newRecord = new record();
newRecord.record_title = newRecordBDD.Title;
newRecord.record_text = newRecordBDD.Text;
newRecord.record_date = DateTime.Now;
db.records.InsertOnSubmit(newRecord);
try
{
db.SubmitChanges();
int id = newRecord.ID; // you can access your newRecord to get the ID
}
catch (Exception)
{
throw;
}
If it's helpful to you then please check as Accepted Answers
Hemant KumarPosted Apr 2, 2012, 8:13 AM
txtbxIdentity.Text=id.ToString();