Click here to Skip to main content
15,903,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I used Memo Edit to Display Address, so it contain 4 lines. How to get this 4 lines and how to store it in the Access Database ? Normally if its EditText we Used this code to store
C++
string inno = textEdit12.Text.ToString();
OleDbCommand top = new OleDbCommand("INSERT INTO tablename(number) VALUES (" + inno + ")", conn);
top.ExecuteNonQuery();

his code work for EditText. How to Get and Store it for MemoEdit ??? Help me.
Posted

1 solution

uppose you have 2 columns , A - a Memo one, B a DateTime one:
VB
dim SIRCON as string = "your connection string"
Using conn As New OleDbConnection(SIRCON)
  conn.Open()
  Try
  Using cmd As New OleDbCommand("INSERT INTO MYTABLE (A, B)  VALUES (?,  ?)", conn)
    cmd.Parameters.AddWithValue("P_A", textEdit12.Text.ToString())
    cmd.Parameters.AddWithValue("P_B", DateEdit1.EditValue)

    cmd.ExecuteNonQuery()
  End Using
Finally
 conn.Close()

End Try
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900