MS SQL Conn i web.config fejl?!?!?
Hej med jer....Jeg får en Access Denied når jeg prøver at connecte til min MSSQL Server, via web.config fil.
Min web.config code:
<appSettings>
<add key="NWind" value="server=(local)\NetSDK;
database=Northwind; integrated security=true;" />
</appSettings>
Men hvordan tilføjer det password i den conn Streng her? Hvis det er det der skal til?
Min connString i aspx filen:
<script language="VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
Dim strConnection As String = ConfigurationSettings.AppSettings("NWind")
Dim objConnection As New SqlConnection(strConnection)
Dim strSQL As String = "SELECT FirstName, LastName, Country " & _
"FROM Employees;"
Dim objCommand As New SqlCommand(strSQL, objConnection)
objConnection.Open()
Response.Write("ServerVersion: " & objConnection.ServerVersion & _
vbCRLF & "Datasource: " & objConnection.DataSource & _
vbCRLF & "Database: " & objConnection.Database)
dgNameList.DataSource = objCommand.ExecuteReader()
dgNameList.DataBind()
objConnection.Close()
End Sub
</script>
Det er ellers den geniale måde at lave det på var! Fuck det mand!
Længe leve ASP.NET Hurra Hurra!!!!!!!!!!!!!!! Hehe
Mvh ecoder