24 VB.NET Articles - Sselect and edit a record in GridView in vb.net
Viewing Article

Current Rating :

Sselect and edit a record in GridView in vb.net

Saturday, March 05, 2011Posted by admin

Category:Database Manipulation in VB.NET
 

If you want to select a record in a Gridview in VB.Net and then edit that record in a separate page, then you can use the following code to give you an idea. I assume that you alredy know how to add a gridview and populate it using vb.net You would need to add a hyperlink field in the gridview columns as shown belo The headertext will show what will appear in the header row datatextfield will be name of your datafield which is the primary key for the data datanavigateurlformatstring - this field will construct the name of your page which the system will navigate to if someone clicks on the edit button datanavigateurlfields is again the primary key eg. My primary key was "NewsId" DataTextFormatString tells what will be displayed on the data gridl eg. I want to show a hyperlink called "Edit" so whenever someone clicks on the edit button the system will take you to the "EditNews.aspx?q=1 where 1 will be the NewsID ----------------------------------------------------------------------------- --------------------------------------------------------------------------- Here is the complete code which shows where the hyperlink code will sit ----------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------

Hits:263      Current Rating :      No Of Ratings: 799      AuthorName: admin
  

Comment#23      Friday, February 11, 2011          Posted by Sumeet Singh

 
Hi this site is really great

Comment#29      Wednesday, April 04, 2012          Posted by Mike Hansen

 
The number of Saturdays or Sundays will always be 4 or 5. After much gnashing of teeth, here is the single formula that gives you the answer. iif(Today.AddDays(-Today.Day).Subtract(Today.AddDays(-Today.Day).AddMonths(-1).AddDays(4-Today.AddDays(-Today.Day).AddMonths(-1).DayOfWeek)).TotalDays/7 >

Comments

Your Name  
 
Your Email( will not appear on page)  
Your Comments