Click here to Skip to main content
15,881,173 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: how to display image from gridview on picturebox Pin
romo2221-Apr-12 6:57
romo2221-Apr-12 6:57 
AnswerRe: how to display image from gridview on picturebox Pin
Eddy Vluggen21-Apr-12 7:03
professionalEddy Vluggen21-Apr-12 7:03 
GeneralRe: how to display image from gridview on picturebox Pin
romo2221-Apr-12 7:11
romo2221-Apr-12 7:11 
GeneralRe: how to display image from gridview on picturebox Pin
Eddy Vluggen21-Apr-12 7:21
professionalEddy Vluggen21-Apr-12 7:21 
GeneralRe: how to display image from gridview on picturebox Pin
Wes Aday21-Apr-12 8:40
professionalWes Aday21-Apr-12 8:40 
QuestionSoap Envelope Response and Download Docs Pin
VBseasons20-Apr-12 20:53
VBseasons20-Apr-12 20:53 
AnswerRe: Soap Envelope Response and Download Docs Pin
Eddy Vluggen20-Apr-12 23:54
professionalEddy Vluggen20-Apr-12 23:54 
QuestionHelp! Saving data from a datagridview to a local table in Visual Studio Pin
AnthonyDailyMail20-Apr-12 8:10
AnthonyDailyMail20-Apr-12 8: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 4:18
professionalEddy Vluggen21-Apr-12 4:18 
GeneralRe: Help! Saving data from a datagridview to a local table in Visual Studio Pin
AnthonyDailyMail23-Apr-12 3:40
AnthonyDailyMail23-Apr-12 3:40 
AnswerRe: Help! Saving data from a datagridview to a local table in Visual Studio Pin
Eddy Vluggen23-Apr-12 8:03
professionalEddy Vluggen23-Apr-12 8:03 
GeneralRe: Help! Saving data from a datagridview to a local table in Visual Studio Pin
AnthonyDailyMail23-Apr-12 4:36
AnthonyDailyMail23-Apr-12 4:36 
GeneralChat without server Pin
Member 885590419-Apr-12 23:00
Member 885590419-Apr-12 23:00 
GeneralRe: Chat without server Pin
Dave Kreskowiak20-Apr-12 3:28
mveDave Kreskowiak20-Apr-12 3:28 
AnswerRe: Chat without server Pin
Eddy Vluggen21-Apr-12 4:20
professionalEddy Vluggen21-Apr-12 4:20 
GeneralRe: Chat without server Pin
Member 422308723-Apr-12 1:37
Member 422308723-Apr-12 1:37 
QuestionVisual Basic.net Pin
Hermaine18-Apr-12 21:39
Hermaine18-Apr-12 21:39 
GeneralRe: Visual Basic.net Pin
Richard MacCutchan18-Apr-12 22:40
mveRichard MacCutchan18-Apr-12 22:40 
AnswerRe: Visual Basic.net Pin
Simon_Whale19-Apr-12 3:06
Simon_Whale19-Apr-12 3:06 
AnswerRe: Visual Basic.net Pin
Dave Kreskowiak19-Apr-12 6:06
mveDave Kreskowiak19-Apr-12 6:06 
AnswerRe: Visual Basic.net Pin
Sentenryu20-Apr-12 1:35
Sentenryu20-Apr-12 1:35 
GeneralRe: Visual Basic.net Pin
Hermaine22-Apr-12 18:56
Hermaine22-Apr-12 18:56 
QuestionRegular Expressions: dealing with a quote Pin
Brad Fackrell18-Apr-12 3:43
Brad Fackrell18-Apr-12 3:43 
AnswerRe: Regular Expressions: dealing with a quote Pin
Eddy Vluggen18-Apr-12 5:02
professionalEddy Vluggen18-Apr-12 5:02 
GeneralRe: Regular Expressions: dealing with a quote Pin
Brad Fackrell18-Apr-12 5:12
Brad Fackrell18-Apr-12 5: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.