Click here to Skip to main content
15,942,847 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I am using gridview with the template fields.If we put list box in the edititem template then if we put sqldatasource then the error is coming "Login failed for sql server".Below is the code.Plz help me.

<asp:TemplateField HeaderText="ImpactedEntity">
       <asp:ListBox ID="ListBox3" runat="server" AutoPostBack="True"
           DataSourceID="SqlDataSource1" DataTextField="ImpactedEntity"
       <asp:SqlDataSource ID="SqlDataSource1" runat="server"
           ConnectionString="<%$ ConnectionStrings:DashboardConnectionString %>"
           SelectCommand="SELECT [ImpactedEntity] FROM [Bug]"></asp:SqlDataSource>
   <asp:TextBox ID="txtImpactedEntity" runat="server">

Thanks in Advance
JoCodes 27-Nov-13 4:22am    
Are you using a different connectionstring for the datasource? if so try to login manually to sql database using the same credentials and check
piyush_singh 27-Nov-13 6:22am    
I think you should confirm whether the connection string is correct or not.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900