how connect the sqldatabase at helloweb.ascx

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
3/3/2011 7:21:44 PM
Gravatar
Total Posts 2

how connect the sqldatabase at helloweb.ascx

Hi i am a newbie here, and i have learn to develop at Training Videos

but i got a problem when i try to add a gridview at helloweb section, and use sqldatabase to connect the App_Data\test.mdf, it is said "An attempt to attach an auto-named database for file D:\website\acmmp\Web\lytest1\App_Data\test.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share"

the helloweb source code below here  

<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="helloweb.ascx.cs" Inherits="lytest.Web.UI.hellowebModule" %>

<portal:mojoPanel ID="mp1" runat="server" ArtisteerCssClass="art-Post" RenderArtisteerBlockContentDivs="true">
<mp:CornerRounderTop id="ctop1" runat="server" />
<asp:Panel ID="pnlWrapper" runat="server" cssclass="art-Post-inner panelwrapper helloweb">
<portal:ModuleTitleControl EditText="Edit" EditUrl="~/helloweb/hellowebEdit.aspx" runat="server" id="TitleControl" />
<portal:mojoPanel ID="MojoPanel1" runat="server" ArtisteerCssClass="art-PostContent">
<asp:Panel ID="pnlhelloweb" runat="server" CssClass="modulecontent">

<div class="settingrow">
        This will soon be the entry point to the helloweb.<br />
       
</div>


</asp:Panel>
</portal:mojoPanel>
<div class="cleared">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
        DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
            <asp:BoundField DataField="age" HeaderText="age" SortExpression="age" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=D:\website\acmmp\Web\lytest1\App_Data\test.mdf;Integrated Security=True;User Instance=True"
        SelectCommand="SELECT * FROM [name]"></asp:SqlDataSource>
    </div>

</asp:Panel>
<mp:CornerRounderBottom id="cbottom1" runat="server" />
</portal:mojoPanel>

3/5/2011 8:44:45 AM
Gravatar
Total Posts 2

Re: how connect the sqldatabase at helloweb.ascx

i fixed the problem when i using appsetting for my connection

You must sign in to post in the forums. This thread is closed to new posts.