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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 ASP.NET Gridview :Generate id in grid

Author  Topic 

taj
Starting Member

39 Posts

Posted - 2013-06-27 : 00:35:34
hi,

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?

SOLUTIONS WITH CODE or SMALL EXAMPLES WILL BE APPRECIATED.

Thanks You
Abhishek

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-27 : 00:55:15
Abhisek you may be better off posting this in some asp.net 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 asp.net forums.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -