Imports System.Data Imports System.Data.SqlClient Imports System.Configuration Partial Class ServiceInvoice Inherits System.Web.UI.Page Dim con As New SqlConnection Dim cmd As New SqlCommand Dim dr As SqlDataReader Dim dt As New DataTable Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dt As New DataTable Dim i As Integer i = GridView1.Rows.Count Dim gvr As New DataTable gvr.Columns.Add(i + 1) gvr.Columns.Add(DropDownList15.SelectedValue.ToString) gvr.Columns.Add(DropDownList16.SelectedValue.ToString) gvr.Columns.Add(TextBox3.Text) gvr.Columns.Add(TextBox4.Text) End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load dt.Columns.Add(New DataColumn(" S.NO ")) dt.Columns.Add(New DataColumn(" TOOLS ")) dt.Columns.Add(New DataColumn(" UNIT PRICE ")) dt.Columns.Add(New DataColumn(" SALES QTY ")) dt.Columns.Add(New DataColumn(" AMOUNT ")) Dim dr As DataRow dr = dt.NewRow dt.Rows.Add(dr) dt.AcceptChanges() GridView1.DataSource = dt GridView1.DataBind() End Sub
Page_Load
DataTable
If Not IsPostBack Then ... End If
Button1_Click
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)