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


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">
   <ItemTemplate>
   <%#Eval("ImpactedEntity")%>
   </ItemTemplate>
   <EditItemTemplate>
       <asp:ListBox ID="ListBox3" runat="server" AutoPostBack="True"
           DataSourceID="SqlDataSource1" DataTextField="ImpactedEntity"
           DataValueField="ImpactedEntity"></asp:ListBox>
       <asp:SqlDataSource ID="SqlDataSource1" runat="server"
           ConnectionString="<%$ ConnectionStrings:DashboardConnectionString %>"
           SelectCommand="SELECT [ImpactedEntity] FROM [Bug]"></asp:SqlDataSource>
   </EditItemTemplate>
    <FooterTemplate>
   <asp:TextBox ID="txtImpactedEntity" runat="server">
                   </asp:TextBox>
   </FooterTemplate>
   </asp:TemplateField>


Thanks in Advance
Posted
Comments
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