How to retrieve value from sqldatasource1 to textbox1 using vb.net?

How to retrieve value from sqldatasource1 to textbox1 using vb.net ?

i have a table with field Employee Id : 1001

I wannna retrive the top1 employee id in textbox1 using sqldatasource1

Answers


Something like this may help:

DataView oDataView = new DataView();
oDataView = SqlDataSource1.Select(DataSourceSelectArguments.Empty);
DataRowView dr = oDataView[0];
TextBox1.Text = dr["EmployeeID"].ToString();

I have not tested this code though.

You may also want to read the followings to get more info on SQLDataSource:

http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/sqldatasource.aspx http://www.aspfree.com/c/a/ASP.NET/Programming-the-ASPNET-20-SqlDataSource-Control/ http://www.defaultdotaspx.com/Answer.aspx?QuestionType=ASPNET&QuestionID=149 http://www.mikesdotnetting.com/Article/64/Bind-Data-From-a-SqlDataSource-to-a-Label

Hope this helps!


Need Your Help

IllegalArgumentException on Android Maven Install

android maven android-support-library

I am getting the following exception when attempting a "mvn install" on an Android project.

Soundcloud replying with json instead of xml as requested

curl libcurl soundcloud

In response to my request for an authorization token, Soundcloud is replying with a json string, although I'm asking for xml. Is this a bug, or is it unimplemented, or am I doing something wrong?...