.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> ADO.Net >> Post New QuestionBookmark and Share Subscribe to Forum

I have problem regarding creating connection to database

Posted By: Atulya     Posted Date: August 02, 2010    Points:2   Category :ADO.Net
I have use this command
SqlConnection con = new SqlConnection();
con.ConnectionString="Data Source=Sever name;Intial Catalog = emp;Integrated Security = True";
but I am getting error Arguement exception handled and Keyword not supported: 'intial catalog'.

Author: Sunil Yadav       [Moderator]      
Posted Date: August 02, 2010     Points: 5   


Check spelling it is Initial instead intial.

Author: Syed Shakeer Hussain             
Posted Date: August 02, 2010     Points: 5   

<add name="sqlconnectionstring" connectionString="Data  Source=name;Initial Catalog=DB;
User ID=sa;Password=sa" />

Author: Ramesh durai             
Posted Date: August 02, 2010     Points: 5   

<add name="sqlcon" connectionString="server=<server_name>;data base=<DB_name>;
User ID=<us_id>;Password=<pwd>" />

Ramesh durai
Author: Mallikarjuna Chigicherla             
Posted Date: August 03, 2010     Points: 5   

SqlConnection con = new SqlConnection();
con.Connection String = "Data Source=servername;Initial Catalog=databasename;User ID=sa;Password=123";

I Hope it will helpful for u

Thanks & Regards,
Mallikarjuna Chigicherla
Author: rickyponty             
Posted Date: August 12, 2010     Points: 5   

Connect to a remote database server from anywhere you have access to a desktop.If you have a problem with these, change the columns to DATETIME.

Want to get-on Google's first page and loads of traffic to your website? Hire a SEO Specialist from Ocean Groups  [url=http://oceangroups.org/] seo specialist [/url]

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend