pharaon's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
79 (0.03 per day)
Joined:
18-October 07
Profile Views:
3,113
Last Active:
User is offline Aug 24 2014 03:19 PM
Currently:
Offline

Previous Fields

Country:
Who Cares
Dream Kudos:
0

Latest Visitors

Icon   pharaon has not set their status

Posts I've Made

  1. In Topic: many data with few textboxs

    Posted 21 Aug 2014

    I done this code so far
       Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            BindControls()
            BindingSource1.AddNew()
    
            BindingSource1.EndEdit()
            DataGridView1.DataSource = BindingSource1
        End Sub
    
        Private Sub BindControls()
            Dim adapter As New OleDb.OleDbDataAdapter("select Pname,Birthdate,Qualification,Job,Health,Religion,Tel from members", obj.con)
            Dim insert As New OleDb.OleDbCommand("INSERT INTO members (Pname,Birthdate,Qualification,Job,Health,Religion,Tel) VALUES (@ID,@Pname,@Birthdate,@Qualification,@Job,@Health,@Religion,@Tel)", obj.con)
            adapter.InsertCommand = insert
            insert.Parameters.Add("@Pname", OleDbType.VarChar, 100, "Pname")
            insert.Parameters.Add("@Birthdate", OleDbType.DBDate, 10, "Birthdate")
            insert.Parameters.Add("@Qualification", OleDbType.VarChar, 100, "Qualification")
            insert.Parameters.Add("@Job", OleDbType.VarChar, 100, "Job")
            insert.Parameters.Add("@Health", OleDbType.VarChar, 100, "Health")
            insert.Parameters.Add("@Religion", OleDbType.VarChar, 100, "Religion")
            insert.Parameters.Add("@Tel", OleDbType.VarChar, 100, "Tel")
            adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
    
            Dim table As New DataTable
            adapter.FillSchema(table, SchemaType.Source)
            'table.Rows.Add(TextBox4.Text.Trim, DateTimePicker2.Value, TextBox6.Text.Trim, TextBox7.Text.Trim, TextBox8.Text.Trim, TextBox9.Text.Trim, CInt(TextBox10.Text))
            BindingSource1.DataSource = table
    
            TextBox4.DataBindings.Add("text", BindingSource1, "Pname")
            DateTimePicker2.DataBindings.Add("Value", BindingSource1, "Birthdate")
            TextBox6.DataBindings.Add("Text", BindingSource1, "Qualification")
            TextBox7.DataBindings.Add("text", BindingSource1, "Job")
            TextBox8.DataBindings.Add("text", BindingSource1, "Health")
            TextBox9.DataBindings.Add("text", BindingSource1, "Religion")
            TextBox10.DataBindings.Add("text", BindingSource1, "Tel")
    
        End Sub
    


    but the DGV only show empty row when I fill the textboxes with data and click the button the DGV show empty row why?
  2. In Topic: many data with few textboxs

    Posted 21 Aug 2014

    any one have an idea for how to get this done
  3. In Topic: many data with few textboxs

    Posted 20 Aug 2014

    up
  4. In Topic: many data with few textboxs

    Posted 16 Aug 2014

    dos that code make sense so far?
    Dim adapter As New OleDb.OleDbDataAdapter("select ID,Pname,Birthdate,Qualification,Job,Health,Religion,Tel from members", con)
    
    Dim insert As New OleDb.OleDbCommand("INSERT INTO members (ID,Pname,Birthdate,Qualification,Job,Health,Religion,Tel) VALUES (@ID,@Pname,@Birthdate,@Qualification,@Job,@Health,@Religion,@Tel)", con)
    
    insert.Parameters.AddWithValue("@Pname", Form3.TextBox4.Text.Trim)
    insert.Parameters.AddWithValue("@Birthdate", Form3.DateTimePicker2)
    insert.Parameters.AddWithValue("@Qualification", Form3.TextBox6.Text.Trim)
    insert.Parameters.AddWithValue("@Job", Form3.TextBox7.Text.Trim)
    insert.Parameters.AddWithValue("@Health", Form3.TextBox8.Text.Trim)
    insert.Parameters.AddWithValue("@Religion", Form3.TextBox9.Text.Trim)
    insert.Parameters.AddWithValue("@Tel", Form3.TextBox10.Text.Trim)
    adapter.InsertCommand = insert
    
    Dim table As New DataTable
    adapter.FillSchema(table, SchemaType.Source)
    Form3.BindingSource1.DataSource = table
    
    Form3.TextBox4.DataBindings.Add(Form3.TextBox4.Text.Trim, Form3.BindingSource1, "Pname")
    Form3.DateTimePicker2.DataBindings.Add(Form3.DateTimePicker2.Value, Form3.BindingSource1, "Birthdate")
    Form3.TextBox6.DataBindings.Add(Form3.TextBox6.Text.Trim, Form3.BindingSource1, "Qualification")
    Form3.TextBox7.DataBindings.Add(Form3.TextBox7.Text.Trim, Form3.BindingSource1, "Job")
    Form3.TextBox8.DataBindings.Add(Form3.TextBox8.Text.Trim, Form3.BindingSource1, "Health")
    Form3.TextBox9.DataBindings.Add(Form3.TextBox9.Text.Trim, Form3.BindingSource1, "Religion")
    Form3.TextBox10.DataBindings.Add(Form3.TextBox10.Text.Trim, Form3.BindingSource1, "Tel")
    
     adapter.Update(table)
    
    
  5. In Topic: many data with few textboxs

    Posted 14 Aug 2014

    View Postastonecipher, on 09 August 2014 - 01:09 AM, said:

    Have a maternal panel, a paternal panel, and a child panel with a button to add more children. You store the children into memory. Then when save is clicked it 'unravels' saving each record. The alternative is to save the parents individually and when entering the children, use a search/ dropdown to select the maternal and paternal foreign keys.

    can you give me an example with code for how to do that

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Comments

pharaon has no profile comments yet. Why not say hello?