Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
12
Answers
How to run a SQL query with windows forms application ?
thiago costa
13y
22.5k
1
Reply
Hello there guys....
Sam Hobbs
helped me stablish a Database connection on the previous thread
http://www.c-sharpcorner.com/Forums/Thread/143677/C-Sharp-sql-connection-class.aspx
..
I think now I have a database connection :D Thanks alot Sam.
Now that I have a connection, I have 3 questions... (1 is solved)
SOLVED 1)In which section of the code (in the previous thread(code provided by Sam)) Where would the "MessageBox.Show("Connected");" be??? (SOLVED)
2)Also, how would I be able to display a query in the datagrid ? .. I would like to select * from pinfo where fname =thiago
3)How would I be able to set Label1.Text = connected ? I want to have the option between putting the code in the class, or on the main code ... but seems like I don't know how to tell the code how to find somethign in class, and class how to find something in main code... :'(
... If I put the code in the class, it says it cant find label 1, if I try to go by myConnection.state, it won't find it from the main code
then, after I acomplish this, I will need to Update the Fname, by code, and also, by typing in the datagrid. then How would I make it autosave ? how would I save by clicking on a button ? ...
just want to be flexible..
Thanks a lot
By the way, the name of the datagrid is datagrid1... Thanks
Post
Reset
Cancel
Answers (
12
)
Next Recommended Forum
How to Serialize a dataset into XML file
Looking for a C# Tutor