how can i get data from SQL northwind.sdf into the textBox ????????? need help
-
Hello Everybody I have a problem with retreiving data from Example Northwind.sdf database I need your help please !!!! I`m very new to C# sharp so please be understanding. So far I got a connection but cannot manage to get data into the text box(i`m using Microsoft Visual C# 2008 Express Edition) I looked into hundreds of examples and still nothing... this is my CODE -----------------
private void getDataButtton_Click(object sender, EventArgs e) { string conString = Properties.Settings.Default.NorthwindConnectionString; using (SqlCeConnection connect = new SqlCeConnection(conString)) { try { connect.Open(); MessageBox.Show("Connection Established"); ..................... ..................... ..................... } catch { MessageBox.Show("Connection Error!!!"); } } }
Dim -
Hello Everybody I have a problem with retreiving data from Example Northwind.sdf database I need your help please !!!! I`m very new to C# sharp so please be understanding. So far I got a connection but cannot manage to get data into the text box(i`m using Microsoft Visual C# 2008 Express Edition) I looked into hundreds of examples and still nothing... this is my CODE -----------------
private void getDataButtton_Click(object sender, EventArgs e) { string conString = Properties.Settings.Default.NorthwindConnectionString; using (SqlCeConnection connect = new SqlCeConnection(conString)) { try { connect.Open(); MessageBox.Show("Connection Established"); ..................... ..................... ..................... } catch { MessageBox.Show("Connection Error!!!"); } } }
Dim -
Once you have connected to the database, use SQLCommand and either SQLDataReader or SQLDataAdapter to get the data. Then set this as the text for the textbox. There are a plenty of examples available on net for doing this.
-
Hello Everybody I have a problem with retreiving data from Example Northwind.sdf database I need your help please !!!! I`m very new to C# sharp so please be understanding. So far I got a connection but cannot manage to get data into the text box(i`m using Microsoft Visual C# 2008 Express Edition) I looked into hundreds of examples and still nothing... this is my CODE -----------------
private void getDataButtton_Click(object sender, EventArgs e) { string conString = Properties.Settings.Default.NorthwindConnectionString; using (SqlCeConnection connect = new SqlCeConnection(conString)) { try { connect.Open(); MessageBox.Show("Connection Established"); ..................... ..................... ..................... } catch { MessageBox.Show("Connection Error!!!"); } } }
DimCan you post your SQL query? Is the connection successful? Can you give any other details, maybe you have the right direction but simply get caught on something simple (as is usually the case). Unfortunately no one will write your code for you, but again post the contents of
Properties.Settings.Default.NorthwindConnectionString
as well as your sql query, and the status of your connection. Then we can help you further.Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]
-
Any chacne that you could post one for my code please?? Seriously I have been trying to find solution for last 5 days !
There's a tutorial here[^]. You should be able to figure it out based on the example, within a day :)
dimo1982 wrote:
Seriously I have been trying to find solution for last 5 days !
Seriously, you won't find ready-to-go solutions that you can copy&paste. Well, not often at least. In stead of trying to find your next solution, just read the documentation, see how the stuff works and make notes.
I are troll :)
-
Can you post your SQL query? Is the connection successful? Can you give any other details, maybe you have the right direction but simply get caught on something simple (as is usually the case). Unfortunately no one will write your code for you, but again post the contents of
Properties.Settings.Default.NorthwindConnectionString
as well as your sql query, and the status of your connection. Then we can help you further.Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]