hi, everyone
i,m trying to make a visual web part with vs 2010 for SharePoint 2010
I put a radgrid on the page but there is no SqlDataSource in the toolbox
so iwrith the datasource in the html cod like this:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:tryoneConnectionString %>"
DeleteCommand="DELETE FROM [ts] WHERE [ticketnumber] = @ticketnumber"
InsertCommand="INSERT INTO [ts] ([Category], [Issue], [description], [Requester], [email], [computername], [hdstatus]) VALUES (@Category, @Issue, @description, @Requester, @email, @computername, @hdstatus)"
SelectCommand="SELECT [ticketnumber], [Category], [Issue], [description], [Requester], [email], [computername], [hdstatus] FROM [ts]"
UpdateCommand="UPDATE [ts] SET [Category] = @Category, [Issue] = @Issue, [description] = @description, [Requester] = @Requester, [email] = @email, [computername] = @computername, [hdstatus] = @hdstatus WHERE [ticketnumber] = @ticketnumber"
ProviderName="<%$ ConnectionStrings:tryoneConnectionString.ProviderName %>">
<DeleteParameters>
<asp:Parameter Name="ticketnumber" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Category" Type="String" />
<asp:Parameter Name="Issue" Type="String" />
<asp:Parameter Name="description" Type="String" />
<asp:Parameter Name="Requester" Type="String" />
<asp:Parameter Name="email" Type="String" />
<asp:Parameter Name="computername" Type="String" />
<asp:Parameter Name="hdstatus" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Category" Type="String" />
<asp:Parameter Name="Issue" Type="String" />
<asp:Parameter Name="description" Type="String" />
<asp:Parameter Name="Requester" Type="String" />
<asp:Parameter Name="email" Type="String" />
<asp:Parameter Name="computername" Type="String" />
<asp:Parameter Name="hdstatus" Type="String" />
<asp:Parameter Name="ticketnumber" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
then i have found the datasource on the page i bind it to the radgrid
everything is ok
when i run the project i got the following error:
The connection name 'tryoneconnectionstring' was not found in the applications configuration or the connection string is empty.
my web.config & app.config in the attached
i,m trying to make a visual web part with vs 2010 for SharePoint 2010
I put a radgrid on the page but there is no SqlDataSource in the toolbox
so iwrith the datasource in the html cod like this:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:tryoneConnectionString %>"
DeleteCommand="DELETE FROM [ts] WHERE [ticketnumber] = @ticketnumber"
InsertCommand="INSERT INTO [ts] ([Category], [Issue], [description], [Requester], [email], [computername], [hdstatus]) VALUES (@Category, @Issue, @description, @Requester, @email, @computername, @hdstatus)"
SelectCommand="SELECT [ticketnumber], [Category], [Issue], [description], [Requester], [email], [computername], [hdstatus] FROM [ts]"
UpdateCommand="UPDATE [ts] SET [Category] = @Category, [Issue] = @Issue, [description] = @description, [Requester] = @Requester, [email] = @email, [computername] = @computername, [hdstatus] = @hdstatus WHERE [ticketnumber] = @ticketnumber"
ProviderName="<%$ ConnectionStrings:tryoneConnectionString.ProviderName %>">
<DeleteParameters>
<asp:Parameter Name="ticketnumber" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Category" Type="String" />
<asp:Parameter Name="Issue" Type="String" />
<asp:Parameter Name="description" Type="String" />
<asp:Parameter Name="Requester" Type="String" />
<asp:Parameter Name="email" Type="String" />
<asp:Parameter Name="computername" Type="String" />
<asp:Parameter Name="hdstatus" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Category" Type="String" />
<asp:Parameter Name="Issue" Type="String" />
<asp:Parameter Name="description" Type="String" />
<asp:Parameter Name="Requester" Type="String" />
<asp:Parameter Name="email" Type="String" />
<asp:Parameter Name="computername" Type="String" />
<asp:Parameter Name="hdstatus" Type="String" />
<asp:Parameter Name="ticketnumber" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
then i have found the datasource on the page i bind it to the radgrid
everything is ok
when i run the project i got the following error:
The connection name 'tryoneconnectionstring' was not found in the applications configuration or the connection string is empty.
my web.config & app.config in the attached