.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

DataGridView

Posted By: srini     Posted Date: February 02, 2011    Points:2   Category :VB.Net
Hi,

I need a code for edit,update and delete the values from datagridview using vb.net windows appl and sql server2005.

Send the code soon!

Thanks,
Srini.

Responses
Author: shankey             
Posted Date: February 02, 2011     Points: 5   
Author: Syed Shakeer Hussain             
Posted Date: February 02, 2011     Points: 5   
Author: srini             
Posted Date: February 02, 2011     Points: 5   

Hi,

Thanks for your post.

In your examples, I found for edit the DataGrid Selected Row. But its showing very first record instead of showing second,third and so on.

I used the code like,

Private Sub DataGridView1_CellContentClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
Dim i As Integer
i = DataGridView1.SelectedCells(0).RowIndex
txtPer.Text = DataGridView1.Rows(i).Cells(0).Value.ToString()
txtLas.Text = DataGridView1.Rows(i).Cells(1).Value.ToString()
txtFir.Text = DataGridView1.Rows(i).Cells(2).Value.ToString()
txtAdd.Text = DataGridView1.Rows(i).Cells(3).Value.ToString()
txtCity.Text = DataGridView1.Rows(i).Cells(4).Value.ToString()
End Sub

Thanks,
Srini.


Srini


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend