hiryu23
07-18-2005, 03:52 AM
Hi, recently i have setup a SQL server and i have occur a few problems.
1) I have tried connecting to the SQL server on my client using SQL enterprise manager. And no error occurs. But when i tried using ASP.NET connecting to the SQL server on my client, there is an error which shows,
SQL Server does not exist or access denied.
2) i wonder if there's any setting i need to set on SQL server? or in my ASP.NET, please help
below are the codes:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim cn As New SqlConnection("server=FYPSERVER;uid=sa;pwd=ckpuni123;database=FYPGamePortal")
Dim cmd As New SqlCommand("Select * from tblNews", cn)
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds, "tblNews")
DropDownList1.DataTextField = "intNewsID"
DropDownList1.DataSource = ds.Tables("tblNews")
DropDownList1.DataBind()
End Sub
please help, thanks alot
1) I have tried connecting to the SQL server on my client using SQL enterprise manager. And no error occurs. But when i tried using ASP.NET connecting to the SQL server on my client, there is an error which shows,
SQL Server does not exist or access denied.
2) i wonder if there's any setting i need to set on SQL server? or in my ASP.NET, please help
below are the codes:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim cn As New SqlConnection("server=FYPSERVER;uid=sa;pwd=ckpuni123;database=FYPGamePortal")
Dim cmd As New SqlCommand("Select * from tblNews", cn)
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds, "tblNews")
DropDownList1.DataTextField = "intNewsID"
DropDownList1.DataSource = ds.Tables("tblNews")
DropDownList1.DataBind()
End Sub
please help, thanks alot