cannot insert into database 2005 using visual c# 2008
-
Hello, Please I need very urgent solution to this problem. I have an application writing in C# using sql server 2005 express and visual c# 2008 express. I want to connect and insert data to the database from textbox. Onclick on save button I want the data to be submited into database. I dont want to use the manual way of connecting to databse because the db server will not be on my local maching after the completion of the project. I also want to update retrive data from database and update them as well. Am just learning C# on my own and this is beyond my ability at the moment. Please help me. Waiting for your kind reply Thanks, Ademola
-
Hello, Please I need very urgent solution to this problem. I have an application writing in C# using sql server 2005 express and visual c# 2008 express. I want to connect and insert data to the database from textbox. Onclick on save button I want the data to be submited into database. I dont want to use the manual way of connecting to databse because the db server will not be on my local maching after the completion of the project. I also want to update retrive data from database and update them as well. Am just learning C# on my own and this is beyond my ability at the moment. Please help me. Waiting for your kind reply Thanks, Ademola
I think following link will help you for basic insert,update and delete operations in sql using c#. Beginners guide to accessing SQL Server through C#
-
Hello, Please I need very urgent solution to this problem. I have an application writing in C# using sql server 2005 express and visual c# 2008 express. I want to connect and insert data to the database from textbox. Onclick on save button I want the data to be submited into database. I dont want to use the manual way of connecting to databse because the db server will not be on my local maching after the completion of the project. I also want to update retrive data from database and update them as well. Am just learning C# on my own and this is beyond my ability at the moment. Please help me. Waiting for your kind reply Thanks, Ademola
You may also consider storing all the SQL DB connection information in an XML file instead of hardcoding.
-
You may also consider storing all the SQL DB connection information in an XML file instead of hardcoding.
Thanks for you answer pleas how do I do that?
-
I think following link will help you for basic insert,update and delete operations in sql using c#. Beginners guide to accessing SQL Server through C#
Thank you for the link. I'm now stock here SqlCommand myCommand= new SqlCommand("INSERT INTO table (Column1, Column2) " + "Values ('string', 1)", myConnection); The value is given me problem. How do I get the value from textbox before it can be inserted into batabase. I have design my form and i need to get information from user through the textbox whenever they click the save button on the form. Thanks for your help. Ademola
-
Thanks for you answer pleas how do I do that?
Use System.Xml.XmlDocument in you code to parse the XML document and extract the database name, connection string and other information and save them into your types objects. Use these type objects normally as you do database interaction and transaction.