472,354 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

confused with connections in asp.net

232 100+
i m from asp background
i m very new to asp.net
n i m confused with connections in asp.net
i have a project in asp.net for practice
its web.config file which i think is a connection file has connection with sql express
what should i do to connect it with sql server 2005
Expand|Select|Wrap|Line Numbers
  2. <?xml version="1.0"?>
  3. <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  4. <appSettings/>
  5. <connectionStrings>
  6. <add name="ConnectionString" connectionString="Data Source=localhost\SQLExpress;Initial Catalog=asd;Integrated Security=True" providerName="System.Data.SqlClient"/>
  7. </connectionStrings>
  8. <system.web>
  9. <compilation debug="true"/>
  10. <authentication mode="Windows"/>
  13. </system.web>
  15. </configuration>
Feb 1 '09 #1
8 1340
344 100+
Simple connectionString
<add name="dbConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\dbName.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
Now put your database in the data directroy.
I hope it will help!
Feb 1 '09 #2
232 100+
but i hav to connect it with sql server 2000 or 2005 which hav username and password and server authentication mode.your connection is still with sql express
Feb 2 '09 #3
kunal pawar
297 100+
See "Data Source" is your sever name. Like tt\SQLExpress or may be TT its depeands when you install Sql Server 2005.

Or you can refer connectionstrings.com
Feb 2 '09 #4
Hi kkshansid,
You can have the connectionstring in the web.config file like this:
Expand|Select|Wrap|Line Numbers
  2. <!-- Connection strings-->
  3. <connectionStrings>
  4. <remove name="MyConnectionString"></remove>
  5. <add name="MyConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=MyDB;User ID=mysqlusername;Password=mypassword;pooling=false" providerName="System.Data.SqlClient"/>
  6. </connectionStrings>
Hope this helps.
Feb 2 '09 #5
232 100+
what about authentication mode windows mode dont take user id and password
Feb 2 '09 #6
You can just use Integrated Security=true in the connection string if you are going to use Windows Authentication mode.

Expand|Select|Wrap|Line Numbers
  2. <!-- Connection strings-->
  3. <connectionStrings>
  4. <remove name="MyConnectionString"></remove>
  5. <add name="MyConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=MyDB;Integrated Security=true;pooling=false" providerName="System.Data.SqlClient"/>
  6. </connectionStrings>
Waiting you feedback. Thanks.
Feb 2 '09 #7
232 100+
sql server 2005 details
server name=kkshansid
user id=sa
it is sql server 2005 not sql express
what should be authentication mode?
Feb 2 '09 #8
Now perhaps it is my turn to be confused! It seems you have some different requirement. I hope this link provides you much guidance.


Hope you find the right connection string here. Thank you.
Feb 2 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Mudge | last post by:
Hi, My hosting provider only allows me to use 50 connections to my MySQL database that my Web site will use. I don't know what this 50...
by: Angelos | last post by:
I get this error mysql_pconnect Too many connections ... every now and then. Does anyone knows where it comes from ? There are a lot of sites...
by: C Sharp beginner | last post by:
I'm sorry about this verbose posting. This is a follow-up to my yesterday's posting. Thanks William for your reply. I understand it is a good...
by: Bob | last post by:
We have a production web site that's data intensive (save user input to DB and query for displaying) with the ASP.NET app part on one W2K server and...
by: Peter Proost | last post by:
Hi Group, I've got an interesting problem, I don't know if this is the right group but I think so because everything I've read about it so far...
by: cedgington | last post by:
I wanted to take advantage of the large set of functionality offered by the framework, so for my latest project I'm using managed C++ with .NET v2....
by: Sam Malone | last post by:
Am I just totally missing something here? I'm just new to VS.NET 2005 (using VB.NET) and ADO.NET. I get the impression that ADO.NET can't do what...
by: perryche | last post by:
I have searched the site and probably came across dozens of posts... I am somewhat confused about the replies... here is my situation, see if...
by: Usman Jamil | last post by:
Hi I've a class that creates a connection to a database, gets and loop on a dataset given a query and then close the connection. When I use...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.