SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

taj
Starting Member

India
39 Posts

Posted - 06/27/2013 :  00:35:34  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 06/27/2013 :  00:55:15  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New 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.19 seconds. Powered By: Snitz Forums 2000