473,513 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to get values in text box from database

21 New Member
i have 8 textboxs with one uniqe id (Acc id) . i want to fetch it from database (as i have datas in database), to these texboxs.
plz help me out...........................
Aug 8 '07 #1
2 1135
dip_developer
648 Recognized Expert Contributor
i have 8 textboxs with one uniqe id (Acc id) . i want to fetch it from database (as i have datas in database), to these texboxs.
plz help me out...........................
please elaborate....did not understand your problem....
Aug 8 '07 #2
DKn
53 New Member
hai..

you write a function like this.
Expand|Select|Wrap|Line Numbers
  1. public DataSet GetParticularEmpDetails(int EmpID)
  2.         {
  3.     String connectStr ="EmpDetails.mdb";   //Give the proper connection string  here ;
  4.  
  5.             OleDbConnection con = new OleDbConnection(connectStr);
  6.             con.Open();
  7.             OleDbDataAdapter da = new OleDbDataAdapter("Select * from EmpDetails where EmpID= " +EmpID +" ", con);
  8.  
  9.             DataSet ds = new DataSet();
  10.             da.Fill(ds, "Employee");
  11.             return ds;
  12.          }

in that calling function you will get DS.
Expand|Select|Wrap|Line Numbers
  1. DataSet ds = new DataSet();
  2. ds= GetParticularEmpDetails(EMPID)
  3.  
  4.            txtEmpId.Text = ds.Tables[0].Rows[0][0].ToString();
  5.             txtName.Text = ds.Tables[0].Rows[0][1].ToString();
  6.             txtDesignation.Text = ds.Tables[0].Rows[0][2].ToString();
  7.             txtLocation.Text = ds.Tables[0].Rows[0][3].ToString();
  8.  
Try this. It may work out.

i have 8 textboxs with one uniqe id (Acc id) . i want to fetch it from database (as i have datas in database), to these texboxs.
plz help me out...........................
Aug 8 '07 #3

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

Similar topics

5
4246
by: TG | last post by:
Dear PHP Group, I have two forms that are used to collect user information. The first one takes user inputted values such as fullname, city, address etc. I want these values to display in the...
1
2116
by: pmud | last post by:
I have an ASP.NET web application using C# code. I am trying to insert values from a web form into an SQL database. I am using SQL COMMAND object for this. I need to know HOW TO INSERT THE RADIO...
3
1490
by: Mark | last post by:
Hi, I have an aspx page, that in the PageLoad sub, gets values from a specific record in a database as where the record id is retrieved from the querystring. Thesee values are then used to...
4
16955
by: Todd Perkins | last post by:
Hello all, surprisingly enough, this is my first newsgroup post, I usually rely on google. So I hope I have enough info contained. Thank you in advance for any help! Problem: I am getting...
7
2177
by: Aaron | last post by:
Complete code follows. I am new to .NET programming (and programming in general) and I am having a difficult time understanding how to fill a variable in one sub, and then access it from...
0
7897
by: Jeff Boes | last post by:
I hope this helps someone else ... I had struggled some time ago with attempts to get a rank of values query to work, but then I gave up and set it aside. I had another reason to attack it, and in...
0
4079
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me...
10
4406
by: LionsDome | last post by:
Hello, I have a vb.net page which a bunch of checkboxes. A user can select a checkbox(s) and hit the submit button to store those values in a SQL Server table. This works fine with no problem...
1
3515
by: rekhasc | last post by:
i am using the database SQLSERver 2005, i m new to this i worked in sql server2000... but using sqlserver 2005 i dont know how to insert the values... i write the code but the values is not storing...
8
2162
by: ahilar12 | last post by:
Hi experts, I have a form with many textboxes,listboxes in php.I have a edit button to edit the values in the form.once i click the edit button the existing values should be displayed so that...
0
7257
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
7157
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
7379
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,...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.