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

Google script says - Exceeded maximum execution time

javascript google-apps-script google-spreadsheet

I am using the below script to delete duplicate rows from the google spreadsheet. The script was working good but as the data in the spreadsheet is being added daily, now the script is throwing "Ex...

How to mix a VB program with a C++ Program

c++ vb.net vba user-interface

I have a C++ program that I wrote, and I would like to give it a user interface. Is there any way I can run a C++ program and put the information from the program onto the UI of a VB Application?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.