Click here to Skip to main content
15,918,967 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Need Help Read Text File Line by Line Pin
Richard MacCutchan7-Oct-09 4:29
mveRichard MacCutchan7-Oct-09 4:29 
GeneralRe: Need Help Read Text File Line by Line Pin
Hawkster187-Oct-09 4:30
Hawkster187-Oct-09 4:30 
GeneralRe: Need Help Read Text File Line by Line Pin
Richard MacCutchan7-Oct-09 5:04
mveRichard MacCutchan7-Oct-09 5:04 
QuestionWhy dataset doesn't update the database? What am I missing? Pin
JUNEYT7-Oct-09 2:27
JUNEYT7-Oct-09 2:27 
AnswerRe: Why dataset doesn't update the database? What am I missing? Pin
Henry Minute7-Oct-09 4:31
Henry Minute7-Oct-09 4:31 
GeneralRe: Why dataset doesn't update the database? What am I missing? Pin
JUNEYT7-Oct-09 4:42
JUNEYT7-Oct-09 4:42 
GeneralRe: Why dataset doesn't update the database? What am I missing? Pin
Dave Kreskowiak7-Oct-09 4:52
mveDave Kreskowiak7-Oct-09 4:52 
GeneralRe: Why dataset doesn't update the database? What am I missing? Pin
Henry Minute7-Oct-09 7:01
Henry Minute7-Oct-09 7:01 
In the code you posted, you create a new DataRow, but you never do anything with it.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim Row As DataRow = ProjectsDataSet1.Tables("Projects").NewRow()    // <============================ HERE ==================
    ........................
    ........................
    ........................

    Me.Close()    // <======================= SEE LATER IN POST =========================
End Sub


To try to get this working I will suggest a solution using the code that you already have.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim Row As DataRow = ProjectsDataSet1.Tables("Projects").NewRow()
    Row("FirstName") = textBoxFName.Text    // <============ OBVIOUSLY, REPLACE "FirstName", "LastName" WITH YOUR COLUMN NAMES
    Row("LastName") = textBoxLName.Text     // <============ AND textBoxWhatever WITH YOUR TEXTBOXES

    ProjectsDataSet1.Tables("Projects").Rows.Add(Row)   // <========== THEN PUT THE NEWLY FILLED ROW INTO THE TABLE

    Try
        Me.Validate()
        Me.ProjelerBindingSource.EndEdit()
        Me.ProjelerTableAdapter.Update(Me.ProjectsDataSet1.Tables("Projects"))

        MessageBox.Show(ProjectName.Text & vbCrLf & vbCrLf & "identified!")
    Catch ex As Exception
        MsgBox("Identification is not successful.")
    End Try

    Me.Close()


End Sub


I have not tested this but it should work. Give it a try and get back, if not.

You do realise that your Me.Close() line will close the form, don't you?

Possibly a better way to do this is to give the users a 'New' button. When this is clicked, add a new row to the table and leave it blank. Then since your data entry controls are bound to the table they will be looking at this empty row so that when data is entered into the controls it will also be added to the table. You could then use your Button1_Click as it is except for the NewRow() line, which will no longer be needed.

Hope this makes sense, and helps. Smile | :)

Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

GeneralRe: Why dataset doesn't update the database? What am I missing? Pin
JUNEYT7-Oct-09 7:14
JUNEYT7-Oct-09 7:14 
GeneralRe: Why dataset doesn't update the database? What am I missing? Pin
Henry Minute7-Oct-09 7:48
Henry Minute7-Oct-09 7:48 
QuestionAPPLICATION 1 TO ACCESS GLOBAL VARIABLE THATS IN APPLICATION 2 Pin
Anoop Brijmohun6-Oct-09 23:19
Anoop Brijmohun6-Oct-09 23:19 
AnswerRe: APPLICATION 1 TO ACCESS GLOBAL VARIABLE THATS IN APPLICATION 2 Pin
Dave Kreskowiak7-Oct-09 1:44
mveDave Kreskowiak7-Oct-09 1:44 
GeneralRe: APPLICATION 1 TO ACCESS GLOBAL VARIABLE THATS IN APPLICATION 2 Pin
Anoop Brijmohun7-Oct-09 2:09
Anoop Brijmohun7-Oct-09 2:09 
GeneralRe: APPLICATION 1 TO ACCESS GLOBAL VARIABLE THATS IN APPLICATION 2 Pin
Dave Kreskowiak7-Oct-09 4:49
mveDave Kreskowiak7-Oct-09 4:49 
QuestionRedirect a printing job to another printer Pin
edmonson6-Oct-09 23:03
edmonson6-Oct-09 23:03 
AnswerRe: Redirect a printing job to another printer Pin
Dave Kreskowiak7-Oct-09 1:39
mveDave Kreskowiak7-Oct-09 1:39 
Question[Message Deleted] Pin
sriharsha_126-Oct-09 22:34
sriharsha_126-Oct-09 22:34 
Answer[Message Deleted] Pin
sriharsha_126-Oct-09 22:42
sriharsha_126-Oct-09 22:42 
GeneralRe: Dynamic tabs + ASP.Net + VB.Net Pin
Dave Kreskowiak7-Oct-09 1:38
mveDave Kreskowiak7-Oct-09 1:38 
QuestionHow to interpret Local Languages in Visual Basic 6 Pin
jayachandra.c6-Oct-09 20:06
jayachandra.c6-Oct-09 20:06 
GeneralRe: How to interpret Local Languages in Visual Basic 6 Pin
Rajesh Anuhya6-Oct-09 21:17
professionalRajesh Anuhya6-Oct-09 21:17 
AnswerRe: How to interpret Local Languages in Visual Basic 6 Pin
Dave Kreskowiak7-Oct-09 1:37
mveDave Kreskowiak7-Oct-09 1:37 
QuestionRead Data from EXcel Based on Conditions to Dataset Pin
Dambod6-Oct-09 20:03
Dambod6-Oct-09 20:03 
AnswerRe: Read Data from EXcel Based on Conditions to Dataset Pin
Rajesh Anuhya6-Oct-09 21:15
professionalRajesh Anuhya6-Oct-09 21:15 
QuestionEvent and delegate from C# to VB.NET Pin
sri_00996-Oct-09 18:48
sri_00996-Oct-09 18:48 

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.