| | |
how to connect to a microsoft sql database?
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Apr 2009
Posts: 13
Reputation:
Solved Threads: 0
•
•
•
•
Please I am now making a project using C# and I want to connect to a database how to do this using visual studio 6?
Thanks
hi..
you can make use of the connectionstring as shown below:
string str = "Data Source=*name of your SQL server*;Initial Catalog=*your database name*;Integrated Security=True";
SqlConnection cn = new SqlConnection(str);
string query="your query statement";
cn.Open();
//
rest of the code!!
//
![]() |
Similar Threads
- How do you connect to a sql database using C# (C#)
- Database Connectivity in C (C)
- Remote sql database (ASP.NET)
- [B]How will I connect MS SQL to java?[/B] (MS SQL)
- can i know what software shall i use to connect jsp file to the database? (JSP)
- Connecting to database (VB.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
Other Threads in the C# Forum
- Previous Thread: Symmetric Vs Asymmetric Encryption
- Next Thread: ADO.NET ExecuteNonQuery Problem (Dashes in the string)
Views: 777 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap broadcast button buttons c# check checkbox class client code color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing event excel file files form format forms ftp function gdi+ http httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator path picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





