i trying to create a website using ASP.NET C#. when i choose to create a new website and click on ASP.NET website i get something that's already ready but with a different database. i have my own database i phpAdmin, and i want to connect t that database,
anyone who has some examples or any ideas of how to do it ?
manutd90
Member
3 Points
27 Posts
Connect to my database
Jan 30, 2013 12:43 PM|LINK
Hello
i trying to create a website using ASP.NET C#. when i choose to create a new website and click on ASP.NET website i get something that's already ready but with a different database. i have my own database i phpAdmin, and i want to connect t that database, anyone who has some examples or any ideas of how to do it ?
AidyF
Star
9204 Points
1570 Posts
Re: Connect to my database
Jan 30, 2013 12:46 PM|LINK
Look for the connection string in the web.config file and change it to point to your own database.
http://www.connectionstrings.com/
manutd90
Member
3 Points
27 Posts
Re: Connect to my database
Jan 30, 2013 12:48 PM|LINK
Okay so what is the data source ?
ashkc
Participant
960 Points
200 Posts
Re: Connect to my database
Jan 30, 2013 12:51 PM|LINK
datasource means your database name
manutd90
Member
3 Points
27 Posts
Re: Connect to my database
Jan 30, 2013 12:53 PM|LINK
okay thanks i will try and see if i can figured it out.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Connect to my database
Feb 01, 2013 12:32 AM|LINK
If fails, you can also try this to get the connection string:
1) Open VS
2) Swtich to View=>SQL Server Explorer
3) Try to create a connection to a datatable
4) Copy the connection string
5) Paste it into your web.config.