After my struggle of 3 hours I finally got it working. I thought it would be easy but MSDN was of no help at all and the web is full of all the stupid stuff but not the correct information. People just put in the concept and nobody even bothers to write down the steps to fetch the data after the execution of query.
Here is the code I made with the help of a post on some discussion forum. The title of the topic i read was "Getting Variable value out of a SqlDataSource in asp 2.0".
Following is the automatically generated markup when you configure the sqldatasource from the data tab.
Then to you onclick function just add the following lines:
protected bool CustomerAuthenticate(string username, string password)
{
DataView dv = ((System.Data.DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty)));
TextBox1.Text=dv.Table.Rows[0]["password"].ToString();
//check and return
}
I hope it will help
Wednesday, July 16, 2008
Fetching data into a variable from SqlDataSource in Asp.NET with C#
Posted by vaibhav at 6:50 AM
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment