Dreamweaver 8, SQL and ASP.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wurn
    New Member
    • Sep 2010
    • 3

    Dreamweaver 8, SQL and ASP.NET

    Hey all, the new guy here.

    I need some help, been at witts end for long while now. Im not very good with ASP/ASP.NET/SQL hell anytype of coding, more of a designer.

    Anyway I am trying to create a search field on one page index.aspx and a results page on search_index.as px. I have followed the following link, http://www.pixeldigest .com/aspsearch.html, to the letter and in my Dataset i manage to Test my connection successfully but it does not want to show the info in my browser, what can be the problem?

    Pls dont ask me to use this or that programme, I cannot afford another application now and dont have the time to learn another app as it is. I know this can be done in DW8 with ASP or ASP.NEt and SQL. Below is the code for my search_index.as px page

    Code:
     <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
    <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 name, surname, mobile, ext FROM contact WHERE name LIKE ?") %>'
    CurrentPage='<%# IIf((Request.QueryString("DataSet1_CurrentPage") <> Nothing), Request.QueryString("DataSet1_CurrentPage"), 0)            %>'
    PageSize="10"
    Debug="true"
    >
    <Parameters>
    <Parameter  Name="@contact"  Value='<%# IIf((Not Application("contact") Is Nothing), Application("contact"), "1") %>'  Type="VarChar"   /></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">
    <link href="css/style.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    .style1 {
    	color: #FFFF00;
    	font-weight: bold;
    }
    -->
    </style>
    <script type="text/JavaScript">
    <!--
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    </head>
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/em&amp;pbut_d.jpg','images/cmsbut_d.gif','images/em&amp;pbut_d.gif')">
    <table width="762" height="532" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
    	<tr>
    		<td>
    			<img src="images/index_01.jpg" width="762" height="228" alt=""></td>
    	</tr>
    	<tr>
    		
        <td width="762" height="304" valign="top" bgcolor="#003366"> 
            <table width="100%" height="241" border="0" cellpadding="5" cellspacing="2">
              <tr> 
                <td height="85" colspan="3"><p class="heading">Welcome to Smit Amandla Marine's INTRANET </p></td>
              </tr>
              <tr> 
                <td width="46%" height="90" valign="top" bgcolor="#FFFF00" class="p">&nbsp;</td>
                <td width="26%" valign="top" bgcolor="#FFFF00" class="p"><div align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('cms','','images/cmsbut_d.gif',1)"><img src="images/cmsbut.gif" name="cms" width="103" height="103" border="0"></a></div></td>
                <td width="28%" valign="top" bgcolor="#FFFF00" class="p"><div align="center"><a href="e-m&p/emp.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('emap','','images/em&pbut_d.gif',1)"><img src="images/em&pbut.gif" name="emap" width="103" height="103" border="0"></a></div></td>
              </tr>
              <tr> 
                <td height="28" bgcolor="#0066FF">&nbsp;</td>
                <td bgcolor="#0066FF" class="style1">Company Management System </td>
                <td bgcolor="#0066FF" class="style1">Electronic Maintenance &amp; Purchasing </td>
              </tr>
              <tr>
                <td height="28" valign="top" bgcolor="#0066FF"><table width="100%" height="139" border="1" cellpadding="0" cellspacing="0">
                  <tr>
                    <td>              <ASP:Repeater runat="server" DataSource='<%# DataSet1.DefaultView %>'>
                  <ItemTemplate>
                      <table width="100%" height="135" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                          <td bgcolor="#999999" class="p">Name</td>
                          <td bgcolor="#999999" class="p">Surname</td>
                        </tr>
                        <tr>
                          <td class="p"><span class="p"><%# DataSet1.FieldValue("name", Container) %></span></td>
                          <td class="p"><span class="p"><%# DataSet1.FieldValue("surname", Container) %></span></td>
                          </tr>
                        <tr>
                          <td class="p"><span class="p">Extension</span></td>
                          <td class="p"><span class="p">Mobile</span></td>
                        </tr>
                        <tr>
                          <td class="p"><span class="p"><%# DataSet1.FieldValue("ext", Container) %></span></td>
                          <td class="p"><span class="p"><%# DataSet1.FieldValue("mobile", Container) %></span></td>
                        </tr>
                      </table>
                    </ItemTemplate>
                  </ASP:Repeater></td>
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Instead of using the DreamweaverCtrl s version of a DataSet, try using the ASP.NET DataSet.

    -Frinny

    Comment

    • Wurn
      New Member
      • Sep 2010
      • 3

      #3
      Hey Frinny, thx for the reply and I'll have a look at the link.

      To be honest I doubt if I'll be able to incorporate what is said into my webpage and get it to work. Surely what I have currently needs a slight adjustment and not need to be rewritten?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        I'm sorry but I've never used DreamweaverCtrl s before.

        I know that ASP.NET controls work in ASP.NET applications and I don't know anything about how DreamweaverCtrl s work in ASP.NET applications (or how to use them...or anything about them really).

        Since you are using an ASP.NET Repeater control to display the data, I recommend that you use the ASP.NET DataSet (or a DataTable within it) so that you can easily bind the controls.

        Depending on the database you are connecting to, you could also consider using something like the SqlDataSource control which could make binding easier.

        -Frinny

        Comment

        • Wurn
          New Member
          • Sep 2010
          • 3

          #5
          Thx man, but still not making sense to me much. Like I said I'm not very good at coding.

          Comment

          Working...