1
Answer

how to get gridview text box values within button in c#

Photo of Raja A

Raja A

11y
883
1
How to get grid view textbox value within submit button .. Button should be outside from gridview..... Can anyone help with code...

Answers (1)

2
Photo of Rafnas T P
NA 12.2k 435.7k 8y
here you cannot make S_no as primary key. if you want like this esult that add new column and make that as primary key
Accepted
2
Photo of Nitin Sontakke
NA 11.7k 2.2k 8y
Sort of....
 
The top portion goes in one table and the grid data goes in another table. And you will need to maintain the relation.
 
2
Photo of Nitin Sontakke
NA 11.7k 2.2k 8y
When you say S_no = Identity primary key, it cannot be 1, 1, 1, 2, 3, 3. It has to be 1, 2, 3, 4, 5, 6, etc.
 
2
Photo of Nitin Sontakke
NA 11.7k 2.2k 8y
I suggest two tables here. You may not think about it today, but tomorrow you will need them. See carefully.
 
table 1  : tblBill
 
BillNo - this is the primary key. Try NOT TO have two separate columns as sr no as pk and bill no as a separate column.
BillDate, Custoer Id, Tax amount, etc. You will have several columns which will go in header table.
 
BillNo BillDate, etc... 
1
2
3
  
table 2 : tblBillDetail
 
BillDetailId - PK running id, 
BillNo - FK to above table
BillDetailId 1 2 3 for a single bill. If i implement, I will NOT have it. Not required.
then you will have quantity, price, etc. 
 
BillDetailId,  BillNo, BillDetailId
1 1 1
2 1 2
3 1 3
4 2 1
5 2 2
6 2 3
7 3 1
 
 
 
 
1
Photo of Jyoti Jodha
NA 1.7k 40.7k 8y

Attachment AddDatabase.zip

like this
1
Photo of Jyoti Jodha
NA 1.7k 40.7k 8y
ohk Sir
 
 I am try