Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Gridview Search (please help me)Gridview Search (please help me)
Previous
 
Next
New Post
11/20/2007 10:49 AM
 

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

 

 
New Post
11/24/2007 2:02 PM
 

<add key="ConnectionString" value="Data Source=*****;initial catalog=(Database name);Persist Security Info=True;User ID=*****;Password=******"/>

Not sure if you ommited the DB name or if it was just missing from the connection string, but it may be the error if it's not there

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Gridview Search (please help me)Gridview Search (please help me)


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out