473,672 Members | 2,683 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 1139
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....di d 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
4253
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 second form when it is called. Both forms are .htm files that call themselves when the submit button is press via the following command in each form: <form method="post" action="<?php $server?>">
1
2126
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 BUTTON LIST SELECTION entered by the user in the web form into tha database. for eg. for inserting values from a text box into the database we write code :: sqlCommand1.Parameters.Value =TextBox1.Text & for inserting integer values we write::...
3
1501
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 populate a series of text boxes, radio button selections and drop down list selections. This all works. I run into a problem when I change the values of one of these populated items. When a button is clicked to update the database with the modified...
4
16976
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 this error when I try to pull up my edit page to display the current database information in the form, and then edit it on click:
7
2191
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 another. I have tried declaring them as shared, public, friend, etc and I always get an error stating that something is not valid on a local variable declaration. For example, in the following code for Sub DataGrid_Select, I have CurrentID and...
0
7905
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 between then and now I learned how to return "setof" values from a function, as well as how to construct "dynamic" queries inside a function. Returning the top 10 values from a query is no big deal: create table my_table (field1 integer,...
0
4092
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 with my problems. Now for my new little problem,I had a problem posting the values from checkbox fields to a database and thats the obstacle I overcame. Now the second part is my new problem is that I want that the next time that page loads for...
10
4454
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 the first time the user submits. However when user submits a second time while changing some of the selected boxes the page only re-submits the previosly selected checkbox values. It's like its storing it somewhere in the cache or something. My...
1
3523
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 in the database if anybody knows plz help me... sql server2005 server type: database Engine authentication :windows authentication here is my code private void butinsert_Click(object sender, EventArgs e) {
8
2174
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 the user can edit those particular values and also that should be updated in the mysql database.kindly reply me as early as possible. Thanks
0
8486
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8828
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7446
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6238
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5705
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2819
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 we have to send another system
2
2063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.