Sunday, October 19, 2014

How to Bind the data to the table using vb.net and HTML

Posted by Gnani Palepu  |  1 comment


 if you want more related search please click here  
 please help to other  
 http://scriptquery.blogspot.in/  

 Binding the sqldata to the table  
 --------------------------------  
 step1:  
 --------  
 adding the table in aspx page;  
                   <table style="border-width: 1px; border-color: black; height: 83px; width: 278px;">  
                     <tr>  
                       <td>  
                         Header  
                       </td>  
                       <td>  
                         Text  
                       </td>  
                     </tr>  
                     <tr>  
                       <td>  
                         <asp:Label runat="server" ID="lblhead1"></asp:Label>  
                       </td>  
                       <td>  
                         <asp:Label ID="lbltext1" runat="server"></asp:Label>  
                       </td>  
                     </tr>  
                     <tr>  
                       <td>  
                         <asp:Label runat="server" ID="lblhead2"></asp:Label>  
                       </td>  
                       <td>  
                         <asp:Label ID="lbltext2" runat="server"></asp:Label>  
                       </td>  
                     </tr>  
                     <tr>  
                       <td>  
                         <asp:Label runat="server" ID="lblhead3"></asp:Label>  
                       </td>  
                       <td>  
                         <asp:Label ID="lbltext3" runat="server"></asp:Label>  
                       </td>  
                     </tr>  
                  </table>  
 step 2:  
 Protected Sub GridviewDataTable()  
     Try  
       Dim dt As New DataTable, strSql As String  
       strSql = "SELECT TOP 3 Header, Text FROM UtlAlerts ORDER BY AlertID DESC"  
       dt = Clssvt.getDATATable(strSql)  
       lblhead1.Text = dt.Rows(0)("Header").ToString()  
       lbltext1.Text = dt.Rows(0)("Text").ToString()  
       lblhead2.Text = dt.Rows(1)("Header").ToString()  
       lbltext2.Text = dt.Rows(1)("Text").ToString()  
       lblhead3.Text = dt.Rows(2)("Header").ToString()  
       lbltext3.Text = dt.Rows(2)("Text").ToString()  
     Catch ex As Exception  
     End Try  
   End Sub  
   Protected Sub TotalGridviewDataTable()  
     Dim dt As New DataTable, strSql As String  
     strSql = "select Header,Text from UtlAlerts order by Header desc"  
     dt = Clssvt.getDATATable(strSql)  
     radGrid.DataSource = dt  
     radGrid.DataBind()  
     'Session("MenuAlerts") = dt  
   End Sub  
 step 3 connect to database:  
 Binding the sqldata to the table  

 if you want more related search please click here  
 please help to other  
 http://scriptquery.blogspot.in/  


12:12 AM Share:

1 comments:

Get updates in your email box
Complete the form below, and we'll send you the best coupons.

Deliver via FeedBurner
Proudly Powered by Blogger.
back to top