asp dot net - session state
-
Now I need a help from you quite urgent. I read a data from DataSet as EmpID. Display the EmpID in form1.aspx using Label control. Data Enter in textbox controll like salary. Now click a submit button. The form refresh and update the salary respective EmpID. Next we want the empID move to next employee. How to apply the above task. I try to session state but not working. my form was developed following method. form.aspx " runat="server"> form.aspx.vb dim cmd as new sqlcommand("Select EmpID from MyTable", connection) dim adp as new sqldataadapter(cmd) dim ds as new DataSet() Try connection.open() adp.fill(ds,"MyTable") session("ds") = ds.tables("MyTable") catch finally connection.close() end try abglorie
-
Now I need a help from you quite urgent. I read a data from DataSet as EmpID. Display the EmpID in form1.aspx using Label control. Data Enter in textbox controll like salary. Now click a submit button. The form refresh and update the salary respective EmpID. Next we want the empID move to next employee. How to apply the above task. I try to session state but not working. my form was developed following method. form.aspx " runat="server"> form.aspx.vb dim cmd as new sqlcommand("Select EmpID from MyTable", connection) dim adp as new sqldataadapter(cmd) dim ds as new DataSet() Try connection.open() adp.fill(ds,"MyTable") session("ds") = ds.tables("MyTable") catch finally connection.close() end try abglorie
Hi, You may want to look more into using a datareader for this type of usuage if your wanting to cycle through a record at a time. An SqlDataReader sits in the System.Data.SqlClient namespace. You call a read by something like this (this isn't perfect code as I work in c#!) SqlConnectionconnection = newSqlConnection("myconnectionstringhere") Dim command As SqlCommand = newSqlCommand("SELECT * FROM Customers", connection) connection.Open() Dim data As SqlDataReader = command.ExecuteReader() data.read() The Data.Read method will advance and retrieve the next record. Remember to close the connection once your done with it. Do a search on google for SqlDateReader and you will get information on it's usage back. Regards Paul