executeNonQuery( ) 出错了
'保存Private Sub MenuItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem9.Click
Dim s As String, name As String
If txttitle.Text = "" Then
MsgBox("请输入日记标题", MsgBoxStyle.Exclamation Or MsgBoxStyle.OKOnly, "标题")
Else
name = txttitle.Text & ".txt"
s = Application.StartupPath() + "\" & txttitle.Text & ".txt"
RichTextBox1.SaveFile(s, RichTextBoxStreamType.PlainText)
MsgBox("保存成功", MsgBoxStyle.OKOnly, "保存文件")
Dim connstr, insertcmd As String
Dim selectComd As String = "select * from riji"
c
insertcmd = "insert into riji(title) values (" & (txttitle.Text) & ")"
Dim conn As OleDbConnection, myadapter As OleDbDataAdapter
Dim mydataset As New DataSet
Dim cmd As OleDbCommand
conn = New OleDbConnection(connstr)
conn.Open()
cmd = New OleDbCommand(insertcmd, conn)
cmd.ExecuteNonQuery()
conn.Close()
ListBox1.DataSource = mydataset.Tables("riji")
Me.ListBox1.DisplayMember = "title"
End If
End Sub
cmd.ExecuteNonQuery() 出错了。不知道怎么改,谢谢大家