asp.net DW8 datagrid info not displaying

  • Wurn
  • Graduate
  • Graduate
  • User avatar
  • Posts: 122
  • Loc: Cape Town

Post 3+ Months Ago

Hey all, Ive managed to connect to my MS Access db to do a easy search function using MS visual web developer 2008 express.

I want to do the same in DW8, using asp .net also but even after following various tutorials on how to, I still cannot get my search function to work in DW8. I find it much easier making a webpage look good in DW8 than MS visual web developer, so I'd like to use DW8. I know its possible and I know im just doing something wrong here which will be easy for a good developer to figure out.

Any advice will be appreciated. Here's my code:

Code: [ Select ]
<MM:DataSet
id="DataSet1"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_phone") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_phone") %>'
CommandText='<%# "SELECT tblExt, tblMobile, tblName, tblSurname FROM contact WHERE tblName = ?" %>'
PageSize="3"
Debug="true"
>
 <Parameters>
<Parameter Name="@tblName" Value='<%# IIf((Request.Form("searchform") <> Nothing), Request.Form("searchform"), "") %>' Type="WChar"  /></Parameters></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<html>
<head>
<title>Intranet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  1. <MM:DataSet
  2. id="DataSet1"
  3. runat="Server"
  4. IsStoredProcedure="false"
  5. ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_phone") %>'
  6. DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_phone") %>'
  7. CommandText='<%# "SELECT tblExt, tblMobile, tblName, tblSurname FROM contact WHERE tblName = ?" %>'
  8. PageSize="3"
  9. Debug="true"
  10. >
  11.  <Parameters>
  12. <Parameter Name="@tblName" Value='<%# IIf((Request.Form("searchform") <> Nothing), Request.Form("searchform"), "") %>' Type="WChar"  /></Parameters></MM:DataSet>
  13. <MM:PageBind runat="server" PostBackBind="true" />
  14. <html>
  15. <head>
  16. <title>Intranet</title>
  17. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


and

Code: [ Select ]
  <td height="30" align="center" valign="bottom"><form method="post" name="searchform" runat="server" >
   <table width="90%" border="0" align="center" cellpadding="7" cellspacing="0">
   <tr>
    <td><div align="center">
     <p class="main">
      <input name="TXTfield" type="text" id="TXTfield" size="25">
      &nbsp;
      <input name="BTNSubmit" type="submit" id="BTNSubmit" value="Search">
     </p>
     </div></td>
   </tr>
  </table>
    <p>&nbsp;
     <asp:DataGrid
 AllowCustomPaging="true"
 AllowPaging="true"
 AllowSorting="False"
 AutoGenerateColumns="false"
 CellPadding="3"
 CellSpacing="0" CssClass="table"
 DataSource="<%# DataSet1.DefaultView %>" id="DGrid1"
 PagerStyle-Mode="NextPrev"
 PageSize="<%# DataSet1.PageSize %>"
 runat="server"
 ShowFooter="false"
 ShowHeader="true"
 OnPageIndexChanged="DataSet1.OnDataGridPageIndexChanged"
 VirtualItemCount="<%# DataSet1.RecordCount %>"
>
      <HeaderStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />     
      <ItemStyle BackColor="#F2F2F2" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />     
      <AlternatingItemStyle BackColor="#E5E5E5" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />     
      <FooterStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />     
      <PagerStyle BackColor="white" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />     
      <Columns>
      <asp:BoundColumn DataField="tblName"
    HeaderText="Name"
    ReadOnly="true"
    Visible="True"/>      
      <asp:BoundColumn DataField="tblSurname"
    HeaderText="Surname"
    ReadOnly="true"
    Visible="True"/>      
      <asp:BoundColumn DataField="tblExt"
    HeaderText="Ext"
    ReadOnly="true"
    Visible="True"/>      
      <asp:BoundColumn DataField="tblMobile"
    HeaderText="Mobile"
    ReadOnly="true"
    Visible="True"/>      
</Columns>
     </asp:DataGrid>
  1.   <td height="30" align="center" valign="bottom"><form method="post" name="searchform" runat="server" >
  2.    <table width="90%" border="0" align="center" cellpadding="7" cellspacing="0">
  3.    <tr>
  4.     <td><div align="center">
  5.      <p class="main">
  6.       <input name="TXTfield" type="text" id="TXTfield" size="25">
  7.       &nbsp;
  8.       <input name="BTNSubmit" type="submit" id="BTNSubmit" value="Search">
  9.      </p>
  10.      </div></td>
  11.    </tr>
  12.   </table>
  13.     <p>&nbsp;
  14.      <asp:DataGrid
  15.  AllowCustomPaging="true"
  16.  AllowPaging="true"
  17.  AllowSorting="False"
  18.  AutoGenerateColumns="false"
  19.  CellPadding="3"
  20.  CellSpacing="0" CssClass="table"
  21.  DataSource="<%# DataSet1.DefaultView %>" id="DGrid1"
  22.  PagerStyle-Mode="NextPrev"
  23.  PageSize="<%# DataSet1.PageSize %>"
  24.  runat="server"
  25.  ShowFooter="false"
  26.  ShowHeader="true"
  27.  OnPageIndexChanged="DataSet1.OnDataGridPageIndexChanged"
  28.  VirtualItemCount="<%# DataSet1.RecordCount %>"
  29. >
  30.       <HeaderStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />     
  31.       <ItemStyle BackColor="#F2F2F2" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />     
  32.       <AlternatingItemStyle BackColor="#E5E5E5" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />     
  33.       <FooterStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />     
  34.       <PagerStyle BackColor="white" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />     
  35.       <Columns>
  36.       <asp:BoundColumn DataField="tblName"
  37.     HeaderText="Name"
  38.     ReadOnly="true"
  39.     Visible="True"/>      
  40.       <asp:BoundColumn DataField="tblSurname"
  41.     HeaderText="Surname"
  42.     ReadOnly="true"
  43.     Visible="True"/>      
  44.       <asp:BoundColumn DataField="tblExt"
  45.     HeaderText="Ext"
  46.     ReadOnly="true"
  47.     Visible="True"/>      
  48.       <asp:BoundColumn DataField="tblMobile"
  49.     HeaderText="Mobile"
  50.     ReadOnly="true"
  51.     Visible="True"/>      
  52. </Columns>
  53.      </asp:DataGrid>
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Wurn
  • Graduate
  • Graduate
  • User avatar
  • Posts: 122
  • Loc: Cape Town

Post 3+ Months Ago

OK, I think the problem I'm having is that my search Form is not talking to my db connection. Any idea's

Quote:
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_phone") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_phone") %>'
CommandText='<%# "SELECT tblExt, tblMobile, tblName, tblSurname FROM contact WHERE tblName = ?" %>'
PageSize="3"
Debug="true"
>
<Parameters>
<Parameter Name="@tblName" Value='<%# IIf((Request.Form("searchform") <> Nothing), Request.Form("searchform"), "") %>' Type="WChar" /></Parameters></MM:DataSet>

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 101 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.