I am getting this error message "The connection name 'ConnectionString' was not found in the applications configuaration or the connection string is empty"
Could you tell me what is the remedy for that.
<add key="ConnectionString" value="Data Source=*****;initial catalog=Persist Security Info=True;User ID=*****;Password=******"/>
using the info above, can we say that the connecntion name is ConnectionString right??
*******************************************************************************************************************************************************************
The original code is below down: The content in bold is the one i have added in that code and when i execute that code, i get the error message in the top. Either the code itself is wrong or something is wrong. Could you people figure this out. I am a newbie in .NET
**********************************************************************************************************************************************
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="viewEditCourse.aspx.cs" Theme="Default"
MasterPageFile="~/Admin
/AdminMasterPage.master" Inherits="viewEditCourse" %>
<asp:Content ID="usrMenu" ContentPlaceHolderID="subMenu" runat="server">
<div class="container" id="subMenu">
<ul>
<li><a href=" newCourse.aspx">Add New Course</a></li><li></li>
</ul>
<br /><asp:Label ID="lblError" runat="server" BackColor="Yellow" Font-Bold="True" Font-Italic="False"
ForeColor="Red"></asp:Label>
</div>
</asp:Content>
<asp:Content ID="nUserContent" ContentPlaceHolderID="Contents" runat="server">
<div>
<h2>
View and Edit Course Information</h2>
<h4> Search Course:</h4>
<asp:Textbox ID="textSearch" runat="server"></asp:Textbox>
<asp:RequiredFieldValidator ID="ValidateTextSearch" EnableClientScript="true" ControlToValidate="textSearch" Display=Dynamic ErrorMessage="Must have a value entered" runat="server"></asp:RequiredFieldValidator><br />
<asp:Button ID="buttonSearch" Text="Search" runat="server" />
<br /><br />
<asp:GridView ID="dgCourse" runat="server" AllowPaging="True" AllowSorting="True"
DataKeyNames="CID" AutoGenerateColumns="False" OnRowEditing="dg_editRow" OnRowCancelingEdit="dg_cancelEditRow"
OnRowUpdating="dg_rowUpdating" OnRowDataBound="dg_dataBound" OnSorting="dg_sort"
OnPreRender="dg_prerender" OnRowDeleting="dg_delete" OnPageIndexChanging="dg_paging"
>
<Columns>
<asp:BoundField DataField="CID" HeaderText="Course ID" ReadOnly="True" SortExpression="CID"
Visible="False" />
<asp:TemplateField HeaderText="Course #" SortExpression="CNO">
<EditItemTemplate>
<asp:TextBox ID="txtCNO" runat="server" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblCNo" runat="server" Text='<%# Bind("CNO") %>' /><br />
<asp:HyperLink ID="hyp5" runat="server" Text="Add/View Sections" OnDataBinding="hyp5DataBinding" />
</ItemTemplate>
<ItemStyle Wrap="False" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Course Name" SortExpression="CNAME">
<EditItemTemplate>
<asp:TextBox ID="txtCouName" TextMode="MultiLine" runat="server" Text='<%# Bind("CNAME") %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("CNAME") %>' /><br />
<asp:HyperLink ID="hyp1" runat="server" Text="Add Objective" OnDataBinding="hyp1DataBinding" />
<asp:HyperLink ID="hyp2" runat="server" Text="View Objective" OnDataBinding="hyp2DataBinding" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Category" SortExpression="CAT">
<EditItemTemplate>
<asp:DropDownList ID="ddlCategory" runat="server" DataTextField="CNO" DataValueField="CNO" >
<asp:ListItem> Core Course</asp:ListItem>
<asp:ListItem> Others </asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblCAT" runat="server" Text='<%# Bind("CAT") %>' /><br />
<asp:HyperLink ID="hyp3" runat="server" Text="Assign Faculty" OnDataBinding="hyp3DataBinding" />
<asp:HyperLink ID="hyp4" runat="server" Text="View Faculty" OnDataBinding="hyp4DataBinding" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Edit" ShowHeader="False">
<EditItemTemplate>
<asp:ImageButton ID="Button1" ImageUrl="~/images/updateImg.gif" runat="server" CausesValidation="True"
CommandName="Update" AlternateText="Update" /><br />
<asp:ImageButton ID="Button2" runat="server" ImageUrl="~/images/cancelimg.gif" CausesValidation="False"
CommandName="Cancel" AlternateText="Cancel" />
</EditItemTemplate>
<ItemTemplate>
<asp:Button ID="Button1" runat="server" CausesValidation="False" CommandName="Edit"
Text="Edit" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False" >
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" enabled="false" Visible="false" CausesValidation="False" CommandName="Delete"
ImageUrl="~/images/DelRec.gif" AlternateText="Delete" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ConnectionStrings:ConnectionString %>"
SelectCommand="select * from ITDEDEV.[dbo].BA_COURSES WHERE ([CNO] = @textSearch)">
</asp:SqlDataSource>
</div>
</asp:Content>
Waiting for your replies as soon as possible
Thanks and Regards
Jack