I am a newbie to .NET and C#
I have been asked to maintain a website for a client and am having a problem with an SQL Connection. The error I get is on a page that displays the result of a search against an Access DB and is :
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'dataSet1' does not exist in the current context
Source Error:
Expand|Select|Wrap|Line Numbers
- Line 13: <asp:image id="imgFace" style="Z-INDEX: 101; LEFT: 40px; POSITION: absolute; TOP: 88px" runat="server"
- Line 14: Width="90px" Height="125px"></asp:image><asp:label id="Label1" style="Z-INDEX: 102; LEFT: 152px; POSITION: absolute; TOP: 96px" runat="server"
- Line 15: Width="96px" Height="24px">Last Name :</asp:label><asp:label id=LblName style="Z-INDEX: 103; LEFT: 312px; POSITION: absolute; TOP: 96px" runat="server" Width="176px" Height="24px" Text='<%# DataBinder.Eval(dataSet1, "Tables[Addresses].DefaultView.[0].LastName") %>'>
- Line 16: </asp:label><asp:label id="Label2" style="Z-INDEX: 104; LEFT: 152px; POSITION: absolute; TOP: 192px" runat="server"
- Line 17: Width="128px" Height="24px">ACRICSA number:</asp:label><asp:label id=lblAcricsaNumber style="Z-INDEX: 105; LEFT: 312px; POSITION: absolute; TOP: 192px" runat="server" Width="184px" Height="24px" Text='<%# DataBinder.Eval(dataSet1, "Tables[Addresses].DefaultView.[0].AcricsaNumber") %>'>
Expand|Select|Wrap|Line Numbers
- this.sqlConnection1.ConnectionString = "workstation id=extreme.gam.co.za;packet size=4096;user id=acricsa;password = acri" +
- "csa123;data source=10.0.0.45;persist security info=False;initial catalog=acricsa" +
- "";
BTW - I successfully changed the connection string on other search pages to:
Expand|Select|Wrap|Line Numbers
- this.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=c:\\inetpub\\wwwroot\\acricsa\\acricsa.mdb";
Finally, is there a way of using relative URLs in these strings?
Thanks and Regards