Click here to Skip to main content
14,737,216 members
Home » Discussions » Visual Basic
   

Visual Basic

 
GeneralRe: how to display image from gridview on picturebox Pin
romo2221-Apr-12 7:57
Memberromo2221-Apr-12 7:57 
AnswerRe: how to display image from gridview on picturebox Pin
Eddy Vluggen21-Apr-12 8:03
professionalEddy Vluggen21-Apr-12 8:03 
GeneralRe: how to display image from gridview on picturebox Pin
romo2221-Apr-12 8:11
Memberromo2221-Apr-12 8:11 
GeneralRe: how to display image from gridview on picturebox Pin
Eddy Vluggen21-Apr-12 8:21
professionalEddy Vluggen21-Apr-12 8:21 
GeneralRe: how to display image from gridview on picturebox Pin
Wes Aday21-Apr-12 9:40
professionalWes Aday21-Apr-12 9:40 
QuestionSoap Envelope Response and Download Docs Pin
VBseasons20-Apr-12 21:53
MemberVBseasons20-Apr-12 21:53 
AnswerRe: Soap Envelope Response and Download Docs Pin
Eddy Vluggen21-Apr-12 0:54
professionalEddy Vluggen21-Apr-12 0:54 
QuestionHelp! Saving data from a datagridview to a local table in Visual Studio Pin
AnthonyDailyMail20-Apr-12 9:10
MemberAnthonyDailyMail20-Apr-12 9:10 
Hey everyone, I'm new to this forum. I'm hoping someone can help me understand how to update a table created in visual studio from an unbound datagrid control in a form. The data in the grid control is populated from a text file I import and want to save to the table. Below is the code I'm using. Any thoughts? Frown | :(


[code]
If IsDBNull(Me.FileData.Text) Or Len(Me.FileData.Text) < 1 Then
MsgBox("You must select the reformatter flate file", MsgBoxStyle.Information)
Exit Sub
Else
Using MyReader As New _
Microsoft.VisualBasic.FileIO.TextFieldParser(Me.FileData.Text)
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(",")
Dim currentRow As String()
While Not MyReader.EndOfData
FlatFileImportDataGridView.DataSource = Nothing
Try
currentRow = MyReader.ReadFields()
FlatFileImportDataGridView.Rows.Add(currentRow)
Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
MsgBox("Line " & ex.Message & _
"is not valid and will be skipped.")
End Try
End While
End Using
'FlatFileImportDataGridView.DataSource = FlatFileImportBindingSource
Dim dr As New System.Windows.Forms.DataGridViewRow
For Each dr In Me.FlatFileImportDataGridView.SelectedRows
'Me.DataGridView2.Rows.Add(dr.Cells(0).Value, dr.Cells(1).Value, dr.Cells(2).Value, dr.Cells(3).Value, dr.Cells(4).Value, dr.Cells(5).Value, dr.Cells(6).Value, dr.Cells(7).Value)
Next

For Each row1 As DataGridViewRow In FlatFileImportDataGridView.Rows

Dim copyrow As DataRow = Me.Database1DataSet.FlatFileImport.NewRow

For Each col As DataGridViewCell In row1.Cells
copyrow(col.Value) = (col.Value)
Next
Me.Database1DataSet.FlatFileImport.Rows.Add(copyrow)

Next

Me.FlatFileImportTableAdapter.Update(Me.Database1DataSet.FlatFileImport)

End If
[/code]
AnswerRe: Help! Saving data from a datagridview to a local table in Visual Studio Pin
Eddy Vluggen21-Apr-12 5:18
professionalEddy Vluggen21-Apr-12 5:18 
GeneralRe: Help! Saving data from a datagridview to a local table in Visual Studio Pin
AnthonyDailyMail23-Apr-12 4:40
MemberAnthonyDailyMail23-Apr-12 4:40 
AnswerRe: Help! Saving data from a datagridview to a local table in Visual Studio Pin
Eddy Vluggen23-Apr-12 9:03
professionalEddy Vluggen23-Apr-12 9:03 
GeneralRe: Help! Saving data from a datagridview to a local table in Visual Studio Pin
AnthonyDailyMail23-Apr-12 5:36
MemberAnthonyDailyMail23-Apr-12 5:36 
GeneralChat without server Pin
Member 885590420-Apr-12 0:00
MemberMember 885590420-Apr-12 0:00 
GeneralRe: Chat without server Pin
Dave Kreskowiak20-Apr-12 4:28
mveDave Kreskowiak20-Apr-12 4:28 
AnswerRe: Chat without server Pin
Eddy Vluggen21-Apr-12 5:20
professionalEddy Vluggen21-Apr-12 5:20 
GeneralRe: Chat without server Pin
Member 422308723-Apr-12 2:37
MemberMember 422308723-Apr-12 2:37 
QuestionVisual Basic.net Pin
Hermaine18-Apr-12 22:39
MemberHermaine18-Apr-12 22:39 
GeneralRe: Visual Basic.net Pin
Richard MacCutchan18-Apr-12 23:40
mveRichard MacCutchan18-Apr-12 23:40 
AnswerRe: Visual Basic.net Pin
Simon_Whale19-Apr-12 4:06
professionalSimon_Whale19-Apr-12 4:06 
AnswerRe: Visual Basic.net Pin
Dave Kreskowiak19-Apr-12 7:06
mveDave Kreskowiak19-Apr-12 7:06 
AnswerRe: Visual Basic.net Pin
Sentenryu20-Apr-12 2:35
MemberSentenryu20-Apr-12 2:35 
GeneralRe: Visual Basic.net Pin
Hermaine22-Apr-12 19:56
MemberHermaine22-Apr-12 19:56 
QuestionRegular Expressions: dealing with a quote Pin
Brad Fackrell18-Apr-12 4:43
MemberBrad Fackrell18-Apr-12 4:43 
AnswerRe: Regular Expressions: dealing with a quote Pin
Eddy Vluggen18-Apr-12 6:02
professionalEddy Vluggen18-Apr-12 6:02 
GeneralRe: Regular Expressions: dealing with a quote Pin
Brad Fackrell18-Apr-12 6:12
MemberBrad Fackrell18-Apr-12 6:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.