Connection to SQL server failed

liunx

Guest
i have problem connecting to a sql server database...
i've installed MS SQL server 2000 on XP Pro platform...
i've created a database named "Survey" in the server and used windows integrated authentication as a method for access...but whenever i run my code the page display error message saying the database does not exist or access is denied..
this is my coding...

<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.SqlClient" %>

**the html codes goes here**

<script language="vb" runat="server">

sub page_load(Sender as object, e as eventargs)

dim strConnection as string = "server=(local)\NetSDK; database=Survey;integrated security=true;"
dim objConnection as new SqlConnection(strConnection)
dim strSQL as string = "Select * from member"

dim objAdapter as new SqlDataAdapter(strSQL, objConnection)

dim dataset as new DataSet()
objAdapter.Fill(dataset, "dtMember")

dim temp = Dataset.tables("dtMember").Rows(0)("UserName")
response.Write(temp)

end sub

</script>

please help....


:confused:Try this:

"Integrated Security=true;Initial Catalog=Survey;Data Source=(local)"

or

"Integrated Security=true;Initial Catalog=Survey;Data Source=NetSDK"

They both should work if everything else is set up right.

Good Luck!Make sure your ASP.NET user account has access to the db or this will fail.i've tried the "Integrated Security=true;Initial Catalog=Survey;Data Source=(local)" and "Integrated Security=true;Initial Catalog=Survey;Data Source=NetSDK" but it still doesnt work....

is it that i din install the Mircosoft .Net Framework SDK?...cause i thought the .Net Framework is also ready enough?

hey...i realize there's another account in the account list...one of them is the ASP.net account or something..but when the computer starts...that account is not shown...
so how do i make sure that the account have access to the DB??

thx
 
Back
Top