I'm novice to C#.net & i'm using Visual Studio 2010 as the IDE.I have created a Desktop Application in C# & i want to connect it with the Database in SQL server 2008.Friends can you tell me the code or web links to solve this issue.....
pro_learner 0 Junior Poster
Recommended Answers
Jump to Postusing System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace DatabseConnection { public partial class Form1 : Form { public Form1() { InitializeComponent(); } SqlConnection con; SqlDataAdapter da; DataSet ds1; int MaxRow = 0; int CurRow = 0; …
Jump to PostNavigate record is the method which retrive data from database and dump any where i've call it in a text box
public void NavigateRecords() { DataRow dRow = ds1.Tables["Workers"].Rows[inc]; textBox1.Text = dRow.ItemArray.GetValue(1).ToString(); textBox2.Text = dRow.ItemArray.GetValue(2).ToString(); textBox3.Text = dRow.ItemArray.GetValue(3).ToString(); }
All 8 Replies
sandeepparekh9 109 Posting Whiz
de Source 0 Light Poster
de Source 0 Light Poster
de Source 0 Light Poster
pro_learner 0 Junior Poster
pro_learner 0 Junior Poster
ChrisHunter 152 Posting Whiz in Training Featured Poster
pro_learner 0 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.