| Important : Please do NOT wait for job alert emails. Sometimes, we may NOT be able to send emails due to server problems. So always directly visit www.ChetanaSforum.com to view all jobs DAILY, so that you will NOT miss important Walk-In. We suggest you to LIKE OUR FACEBOOK PAGE to keep track of new jobs through Facebook. |
Home Register Facebook Post Jobs for Free Jobs By Location Exclusive Off-Campus 2013 Batch Job Fairs JavaKen.com TestingKen.com
| Infosys, TCS, Yahoo & Amazon are hiring. Register Now ! | Submit Resume to 50,000 Recruiters | LIKE our FaceBook Page |
![]() ![]() |
Jun 19 2010, 08:03 PM
Post
#1
|
||||||
|
Newbie ![]() Group: Members Posts: 2 Joined: 14-June 10 Member No.: 341,120 |
hai friends pls tell me hoe to get data from DB i know to create form and database connection but i dont know how to get a data..........................
|
|||||
|
|
||||||
Jun 30 2010, 09:20 AM
Post
#2
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 241 Joined: 1-November 08 Member No.: 201,082 |
Try it out here http://www.eggheadcafe.com/community/aspne...rom-ms-acc.aspx
-------------------- |
|
|
|
Jun 30 2010, 09:52 AM
Post
#3
|
|
|
Newbie ![]() Group: Members Posts: 3 Joined: 6-April 10 Member No.: 302,833 |
hai friends pls tell me hoe to get data from DB i know to create form and database connection but i dont know how to get a data.......................... Hi friend..just give this code a try..the table name is customer..here wen u give the customer name in one text box u will get the corresponding cid,address etc in the corresponding text boxes con.Open(); str = "Select * from customer where(cname='" + textBox1.Text + "')"; cmd = new SqlCommand(str, con); dr = cmd.ExecuteReader(); if(dr.HasRows) { while (dr.Read()) { textBox2.Text = dr["cid"].ToString(); textBox3.Text = dr["address"].ToString(); textBox4.Text = dr["landline"].ToString(); textBox5.Text = dr["mobile"].ToString(); textBox6.Text = dr["email"].ToString(); } con.close(); dr.close(); } |
|
|
|
Jul 1 2010, 07:58 PM
Post
#4
|
|
|
Newbie ![]() Group: Members Posts: 9 Joined: 5-February 10 Member No.: 274,092 |
Hi friend..just give this code a try..the table name is customer..here wen u give the customer name in one text box u will get the corresponding cid,address etc in the corresponding text boxes con.Open(); str = "Select * from customer where cname= @custname"; cmd = new SqlCommand(str, con); cmd.Paramaters.Add(new SqlParameter("@custname" + textBox1.Text)); // make it a habit to use above command as its more secure than the one in prev post. dr = cmd.ExecuteReader(); if(dr.HasRows) { while (dr.Read()) { textBox2.Text = dr["cid"].ToString(); textBox3.Text = dr["address"].ToString(); textBox4.Text = dr["landline"].ToString(); textBox5.Text = dr["mobile"].ToString(); textBox6.Text = dr["email"].ToString(); } } dr.close(); con.close(); } just made some changes to the above code... |
|
|
|
Dec 8 2011, 11:19 AM
Post
#5
|
|
|
Newbie ![]() Group: Members Posts: 4 Joined: 7-December 11 Member No.: 864,072 |
Good I like it. This is very useful thread for asp.net developers. It contains useful information. Thanks for sharing it with me.
-------------------- |
|
|
|
May 21 2012, 12:33 PM
Post
#6
|
|
|
Newbie ![]() Group: Members Posts: 5 Joined: 19-May 12 Member No.: 1,028,938 |
Hey...
Its a nice information that you have shared here..I am much happy to see all of these coding because this can be helpful to me for further posting... -------------------- |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th May 2013 - 09:43 AM |