473,387 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

c#.net:retriving data from db to textboxes

can anyone help me,i have placed 2textboxes and a button,one textbox is to give the name ,textbox2 is to retrive values from db(address of a paricular name ),i tried a lot ,but i couldn't make it,help pleaz..................
Apr 16 '10 #1
3 1732
Dheeraj Joshi
1,123 Expert 1GB
Could you please post the relevant code here.
And please use code tags while posting your code.

Regards
Dheeraj Joshi
Apr 16 '10 #2
tlhintoq
3,525 Expert 2GB
I'm sure you understand that to put text in a textbox you just set the textbox.text property.

So I assume the real crux of the problem is in working with a database, right?
Database tutorial Part 1
Database tutorial Part 2
Apr 17 '10 #3
I don't understand what your table looks like. If you are running 3 queries, each returning 1 value which you want to use as the value of your textbox, use ExecuteScalar method of the SqlCommand object.
and then set your values for your textboxes like this:

TextBox2.Text = (string)YourSqlCommandObject.ExecuteScalar();

otherwise you will set TextBox.Text equal to whatever construct you have populated from the database (Datatable, array, etcetera).
Apr 19 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Rocky | last post by:
I have a class which uses a data reader to read in a table from SQL Server. I then loop through each record in the reader, assign it to an instance class then add it to an array list. The...
6
by: Dan | last post by:
Hi Is Microsoft's Sqlhelper.cs (Microsoft Application Blocks for .NET - Data Access) Thread safe? The documentation has no references to threads. Thanks Dan
3
by: Jonathan Woods | last post by:
I could not find Oracle .NET data provider for version 1.1. Do I have to use ODBC .NET data provider for instead? Which provider can offer best access to Oracle Database? I'm using Oracle 8i....
1
by: LongBow | last post by:
Hello, I am attempting to create an application that uses an existing driver interface API using C#. I have an API that looks like F32x_Read( HANDLE Handle, LPVOID Buffer, DWORD...
0
by: msnews.microsoft.com | last post by:
I have Text Box columns in asp.net data grid control . e.g. <ItemTemplate> <asp:TextBox id = txtclock runat = server> </ItemTemplate> I need to display hower help or tooltip for this...
1
by: Robin | last post by:
Are the some sample VB.Net code for using the Oracle.Net data connector?
2
by: James Proctor | last post by:
Hi There, I have written an SQL script which i run though a VB.net application. It has some print statements in which print results of the Script to the message window if you run the script in...
6
by: Jean-Marc Blaise | last post by:
Hi folks, Do you remember an old product working with DB2 V6.1 (LUW) : Net.Data ? This product has been discontinuated in 2004, and it is said that we should use Websphere App Server. Now,...
0
by: Mike C# | last post by:
Has anyone gotten ADO.NET Data Services to actually work with SQL Server 2008 yet? Just wondering, thanks.
1
by: Rory Becker | last post by:
Does anyone have any links to information regarding the security of ADO.Net Data Services (Astoria)? How to close down access to given areas? How to default to no access and open up access...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.