Text Boxes -> DataGridView

shadowspy1

Member
Joined
Jan 23, 2007
Messages
6
Programming Experience
Beginner
I have two forms in my project right now. I have a bindingnavigator with a bunch of textboxes on Form1 which get data from a database. However, the problem I am having, and trying for a long time now looking code up on the internet on the internet and everything, is how to add the data from the textboxes to a DataGridView on Form2. Is there something for coding I just missed out there?
 
So, if I am understanding this correctly then, basically send the info and form a new row in the dataset. Wouldn't the same record, more than once, conflict some where and I am confused when you say new row. I'm trying to keep these to things seperate if I can. Right now I have it set up with two databases, both with identical table columns, and I am trying to pass the one set of info to the datagridview.
 
Ok, I have gotten the ability to get the data values and try to transfer them to the other database. However, the value don't seem to update and the datagridview still displays nothing.
 
Yes I have it bound. The problem I seem to be having it sending the details to the other database. The other database doesn't show that it accepted the data at all.
 
I know I am probably doing this wrong but here is the code.

VB.NET:
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Dim newFlightRow As DataRow = FlightDataSet.Tables("Personal").NewRow()

        newFlightRow("Flight") = FlightTextBox.Text
        newFlightRow("Departing") = DepartingTextBox.Text
        newFlightRow("Arriving") = ArrivingTextBox.Text
        newFlightRow("DepTime") = DepTimeTextBox.Text
        newFlightRow("ArrTime") = ArrTimeTextBox.Text
        newFlightRow("Frequency") = FrequencyTextBox.Text
        newFlightRow("Equipment") = EquipmentTextBox.Text

        FlightDataSet.Tables("Personal").Rows.Add(newFlightRow)

        FlightDataSet.Personal.AcceptChanges()

    End Sub
 
Ok, earlier I was getting an error from a Max Data Value, or something like that, but now it is all taken care of. The problem I am having now is that the program is working, however, the data is not passing to the other table in the database and this is where I am having my trouble.
 
Back
Top