hosseine_haji
پنج شنبه 12 آبان 1390, 08:36 صبح
سلام و خسته نباشید
اگه لطف کنید بفرمایید هر خط از این کد چکار میکنه
SqlConnection myconnection = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\B arati\\Documents\\MyTestDB.mdf;Integrated Security=True;Connect Timeout=30;User
Instance=True")
-------------------------------------------------------------------------------------------------;
SqlCommand newcmd = new SqlCommand("select MAX(tblSell.ID) from tblSell", myconnection);
--------------------------------------------------------------------------------------------------
myconnection.Open();
-----------------------------------------------------------------------
int intres = (int)newcmd.ExecuteScalar();
--------------------------------------------------------------------
myconnection.Close();
---------------------------------------------------------------
Response.Write(intres);
مرسی
اگه لطف کنید بفرمایید هر خط از این کد چکار میکنه
SqlConnection myconnection = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\B arati\\Documents\\MyTestDB.mdf;Integrated Security=True;Connect Timeout=30;User
Instance=True")
-------------------------------------------------------------------------------------------------;
SqlCommand newcmd = new SqlCommand("select MAX(tblSell.ID) from tblSell", myconnection);
--------------------------------------------------------------------------------------------------
myconnection.Open();
-----------------------------------------------------------------------
int intres = (int)newcmd.ExecuteScalar();
--------------------------------------------------------------------
myconnection.Close();
---------------------------------------------------------------
Response.Write(intres);
مرسی