Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 ASP.NET Gridview :Generate id in grid
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

39 Posts

Posted - 06/27/2013 :  00:35:34  Show Profile  Reply with Quote

Hi all,

Urgent Requirement related to gridview.....

Test Name Doctor_Name Sample_Id Sample_Date Select
Blood Test AAA 0 26/06/2013
Urine Test BBB 0 26/06/2013
Lipid Profile CCC 0 26/06/2013
Sugar Test DDD 0 26/06/2013

Above shown the gridview with lab tests, and other detail

In this webform i have button say "Generate Sample ID"

In the above gridview the last column is select column ie;checkbox column.
(Eg patient name :Abhishek)
For First visit of patient(Abhishek) for lab test
The lab assistant will collect the sample and select the tests,which can be done by the collected samples,for those many tests i need to generate a unique sample id Eg:1(ONE),and the remaining tests Sample id should be zero.

For Second Visit of same patient(Abhishek)
The gridview should display only the remaining tests for which samples need to be collected,Now lab assistant will collect the sample and select the tests, which can be done by the collected samples, for those many tests i need to generate a unique sample id Eg:2(TWO) and i should not show the previously generated sample id's ie:1(one).

All these auto-generating of sample id's Should reflect in gridview.

Note:I have button "Generate Sample ID" control in the gridview page, once i clicked the button, sample id value should be generated only for the checked rows(for example if i check first 2 rows in grid then i click the button for those first 2 records only sample id should be Generated as 1 because my last generated sample id is 0) for the next time when i reopen the same page the previously checked rows should not be displayed in the grid whose sample id is 1, and when i check the remaining unchecked rows of grid this time the previously generated number should be incremented by 1 and the number 2 should be generated as a sample Id.
How to fix this?


Thanks You

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 06/27/2013 :  00:55:15  Show Profile  Reply with Quote
Abhisek you may be better off posting this in some forums. This is sql server forum and only way to generate it from db is what i suggested previously. So if your attempt is get this generated from front end, your best bet is to put this in forums.

SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000