Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 connecting asp.net to sql server on other machine

Author  Topic 

guyver
Starting Member

7 Posts

Posted - 2006-07-11 : 23:56:45
hello everybody, im lynard and im a newbie on asp.net. i'd like to know how can i connect asp.net to sql server on other machine. i installed my iis on my local pc which i used for development but my sql server is installed on my domain controller which is the operating system is windows server 2003. my local pc ip address is 192.168.7.28 and my sql server machine ip address is 192.168.7.1

i tried a lot of examples but it didn't work, it shows that it fail to connect sql server. i really craving for answer, i hope someone can help me with this problem. thankksss in advance

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2006-07-12 : 00:16:31
It's just a matter of getting the connection string correct.

See www.connectionstrings.com for more info.

Go to Top of Page

guyver
Starting Member

7 Posts

Posted - 2006-07-12 : 04:07:47
thanks timmy, i tried many connectionstrings but it didn't work. can you give me simple asp.net code tim? i really appreciate your kindness
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-07-12 : 04:16:28
Are you using mixed or windows authentication ? What is the port no of your SQL Server ?

Can you also post your existing connection string ?


KH

Go to Top of Page

guyver
Starting Member

7 Posts

Posted - 2006-07-12 : 04:30:59
hi khtan, my connection strings in my vb application is "provider=sqloledb;database=xxxxx;server=xxxxx;uid=xxxxx;pwd=xxxxx". im working for 3 years in my vb system and im planning to learn web development but when i connect to my sql server it fails. i really don't know how im going to build a new connection string using asp.net and lastly how can i know the port no of my sql server?
Go to Top of Page

karuna
Aged Yak Warrior

582 Posts

Posted - 2006-07-12 : 04:39:25
can you post your connection string part from the web.cofig file?

Thanks
Karunakaran
Go to Top of Page

guyver
Starting Member

7 Posts

Posted - 2006-07-12 : 04:56:02
hi karuna, is connection string saved from web.config? i don't know that part, anyway im using dreamweaver mx 2004 edition in my development site. is this a right tool to create and publish dynamic sites? thanks 4 ur reply
Go to Top of Page

karuna
Aged Yak Warrior

582 Posts

Posted - 2006-07-12 : 07:52:39
you have to specify the connection string in the web.config file..
what version of asp.net you are using?

Modify the connection details add it under<connectionStrings></connectionStrings> section in the web.config. This is for ASP.NET 2.0

<add name="connectionstring1" connectionString="Database=xxxx;Server=xxxx;Integrated Security=False;uid=xxxx;Pwd=xxxxx;"
providerName="System.Data.SqlClient" />


Thanks
Karunakaran
Go to Top of Page

guyver
Starting Member

7 Posts

Posted - 2006-07-12 : 21:43:40
im using asp.net 1.0 karuna

so from web.config file, am i going to call the connection string from that file rather than putting the connection string in asp.net code? am i right?

thanks again but can u give me a simple code just to show that it will connect perfectly in the sql server
Go to Top of Page
   

- Advertisement -