Hi, Mitja Bonca i have allready see this link. SQLSERVER 2005
Let me explain what i have to do..
I am developing an desktop application. by using this application i want to connect server database which is online. (i.e website databse) but unable to connect server datase. i want to retrive as well as insert the values to server db.
Next, you use the SqlConnection object created above to create a 'SqlCommand', as shown below:
SqlCommand cmd = new SqlCommand( "select * from Customer where CustomerID = @Cid", connection);
The SQL query shown here can be replaced by a SELECT, INSERT, UPDATE queries etc.
Next to execute the SQL queries in the database, you use the following methods:
- to execute SELECT queries
- to execute INSERT, DELETE, UPDATE, and SET statements.
This is a very short description of how to connect to SQL Server database from C# and execute SQL queries in the database. For details about the connection string, the methods and their parameters check the following link: ( http://www.shahriarnk.com/Shahriar-N-K-Research-Embedding-SQL-in-C-Sharp-Java.html ) Here you will also find details about how to pass parameters to the SQL queries as well as calling stored procedures and much more.