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
IPB

Welcome Guest ( Log In | Register )




Tags
This content has not been tagged yet
 
Reply to this topicStart new topic
> how to retrive and post data to the database, C#.net,MS Access
bhuvanesh gupta
post Jun 19 2010, 08:03 PM
Post #1


Newbie
*

Group: Members
Posts: 2
Joined: 14-June 10
Member No.: 341,120





Infosys, TCS, Yahoo & Amazon are hiring. Register Now !
If you like this post, please share it to help others.


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..........................

Submit Latest Resume Now !



Go to the top of the page
 
+Quote Post
sean lopez
post 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



--------------------
Go to the top of the page
 
+Quote Post
shamsudeen khan
post Jun 30 2010, 09:52 AM
Post #3


Newbie
*

Group: Members
Posts: 3
Joined: 6-April 10
Member No.: 302,833




QUOTE (bhuvanesh gupta @ Jun 19 2010, 08:03 PM) *
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();
}

Go to the top of the page
 
+Quote Post
ranganathanvp
post Jul 1 2010, 07:58 PM
Post #4


Newbie
*

Group: Members
Posts: 9
Joined: 5-February 10
Member No.: 274,092




QUOTE (shamsudeen khan @ Jun 30 2010, 09:52 AM) *
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...

Go to the top of the page
 
+Quote Post
aquarius
post 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.



--------------------
Go to the top of the page
 
+Quote Post
Egerton John
post 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...



--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th May 2013 - 09:43 AM