Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how can i get data from SQL northwind.sdf into the textBox ????????? need help

how can i get data from SQL northwind.sdf into the textBox ????????? need help

Scheduled Pinned Locked Moved C#
helpdatabasequestioncsharptutorial
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dimo1982
    wrote on last edited by
    #1

    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

    D L 2 Replies Last reply
    0
    • D dimo1982

      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

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      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.

      D 1 Reply Last reply
      0
      • D dan sh

        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.

        D Offline
        D Offline
        dimo1982
        wrote on last edited by
        #3

        Any chacne that you could post one for my code please?? Seriously I have been trying to find solution for last 5 days !

        L 1 Reply Last reply
        0
        • D dimo1982

          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

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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![^]

          D 1 Reply Last reply
          0
          • D dimo1982

            Any chacne that you could post one for my code please?? Seriously I have been trying to find solution for last 5 days !

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            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 :)

            1 Reply Last reply
            0
            • L Lost User

              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![^]

              D Offline
              D Offline
              dimo1982
              wrote on last edited by
              #6

              Ok as soon as I get back home I will post my code

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups