Results 1 to 5 of 5

Thread: How Does ASP.NET Connect to My SQL

  1. #1
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How Does ASP.NET Connect to My SQL

    Hi,

    I'm coming from PHP and am looking at a page but don't understand how the ASPX page connects to the database... Is it to with the MySql.Data.dll file? Also I have noticed that calls from that page to Columns in the MySQL database are written in lowercase... Is this to do with the MySQLDataGrid... Does ASP.NET talk to this first and is this where I need to specifiy what's in the DB?

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Check this one and this one
    Last edited by codeexploiter; 03-02-2007 at 04:45 AM. Reason: added one more link

  3. #3
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by codeexploiter View Post
    Check this one and this one
    I still can't work out how the code on my ASP.NET page works... (they were great articles though)... Could I post it here are you much of a pro at ASP.NET?

  4. #4
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    hmmm i don't know much about ASP.NET I used to work in ASP earlier...But I would recommend posting code as it gives users a chance to see it and try to troubleshoot it for you

  5. #5
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK well here is the code, hopefully someone has some idea as I'm really stuck!
    Code:
    <asp:DataList	ID="MySQLDataGrid"
    runat="server" 
    OnEditCommand="Edit_Command" 
    OnUpdateCommand="Update_Command" 
    OnCancelCommand="Cancel_Command"								
    OnDeleteCommand="Delete_Command" 
    OnItemCreated="btnDelete_ItemCreated" 
    OnItemDataBound="ddl_ItemDataBound"	
    RepeatLayout="Table" 
    DataKeyField="ID" 
    autogeneratecolumns="False" 
    BorderStyle="None"
    BorderWidth="0px" 
    CssClass="gdvw" Width="100&#37;">	
    <headertemplate>
    <tr>
    <td class="label" width="20%">&nbsp;&nbsp;&nbsp;<strong>Firstname</strong></td>
    						<td class="label" width="20%"><strong>Lastname</strong></td>
    <td class="label" width="20%" align="center"><strong>State</strong></td>
    <td class="label" width="20%" align="center">&nbsp;</td>
    <td class="label" width="10%" align="center">&nbsp;</td>
    <td class="label" width="20%" align="center">&nbsp;</td>					
    </tr>					
    </headertemplate>			
    <itemtemplate>
    <tr>
    <td class="label" width="20%">&nbsp;&nbsp;&nbsp;<a title="View Member's Profile" href="javascript:del=window.open('members_view.aspx?id=<%# DataBinder.Eval(Container.DataItem, "ID")%>','del','width=640,height=480,toolbar=no,menubar=no,status=no,titlebar=no,resizable=yes,scrollbars=yes');del.focus();" class="navlink"><%# DataBinder.Eval(Container.DataItem, "Firstname")%></a></td>
    <td class="label" width="20%"><a title="View Member's Profile" href="javascript:del=window.open('members_view.aspx?id=<%# DataBinder.Eval(Container.DataItem, "ID")%>','del','width=640,height=480,toolbar=no,menubar=no,status=no,titlebar=no,resizable=yes,scrollbars=yes');del.focus();" class="navlink"><%# DataBinder.Eval(Container.DataItem, "lastname")%></a></td>
    <td class="label" width="20%" align="center"><%# DataBinder.Eval(Container.DataItem, "state")%></td>
    <td class="label" width="20%" align="center"></td>
    <td class="label" width="10%" align="center"><asp:LinkButton ID="btnEdit" runat="server" CommandName="Edit" Text="Edit " CssClass="navlink" /></td>
    <td class="label" width="10%" align="center"><asp:LinkButton ID="btnDelete" runat="server" CommandName="Delete" Text="Delete" CssClass="navlink" /></td>
    </tr>					
    </itemtemplate>
    <edititemtemplate>
    <tr>
    <td class="label2" width="20%">&nbsp;&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, "firstname")%></td>
    <td class="label2" width="20%"><%# DataBinder.Eval(Container.DataItem, "lastname")%></td>
    <td class="label2" width="20%" align="center"><%# DataBinder.Eval(Container.DataItem, "state")%></td>
    <td class="label2" width="20%" align="center">
    <asp:DropDownList ID="ddlstatus" runat="server" AutoPostBack="False" CssClass="ddl1">
    <asp:ListItem Value="" Text="Please Select..."/>
    <asp:ListItem Value="A" Text="Approved"/>
    <asp:ListItem Value="D" Text="Deleted"/>
    <asp:ListItem Value="H" Text="On Hold"/>
    <asp:ListItem Value="P" Text="Pending"/>
    <asp:ListItem Value="R" Text="Rejected"/>
    </asp:DropDownList></td>
    <td class="label2" width="10%" align="center"><asp:LinkButton ID="btnUpdate" runat="server" CommandName="Update" Text="Update" CssClass="navlink" /></td>
    <td class="label2" width="10%" align="center"><asp:LinkButton ID="btnCancel" runat="server" CommandName="Cancel" Text="Cancel" CssClass="navlink" /></td>
    </tr>
    </edititemtemplate>
    <footertemplate>
    </table>
    </footertemplate>
    
    </asp:DataList>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •