如何在Access数据库中获取MemoEdit和Store? [英] How to get MemoEdit and Store in Access Database?

查看:96
本文介绍了如何在Access数据库中获取MemoEdit和Store?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Memo Edit来显示地址,所以它包含4行。如何获得这4行以及如何将其存储在Access数据库中?通常,如果它的EditText我们使用此代码来存储

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

string inno = textEdit12.Text.ToString();
OleDbCommand top = new OleDbCommand("INSERT INTO tablename(number) VALUES (" + inno + ")", conn);
top.ExecuteNonQuery();



他的代码适用于EditText。如何获取并存储MemoEdit ???帮助我。


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

推荐答案

假设您有2列,A - 备忘录,B a DateTime 1:

uppose you have 2 columns , A - a Memo one, B a DateTime one:
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


这篇关于如何在Access数据库中获取MemoEdit和Store?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆