格式应该没错
myCommand = New OleDbCommand("Insert INTO jqpt(c_date,c_type) Values("+date+","+type+")", myConnection) 在values中到底是绑定表单中的input name还是绑定什么值?
输入input name老是提示未声明名称"+type+"这样!
myCommand = New OleDbCommand("Insert INTO jqpt(c_date,c_type) Values("+date+","+type+")", myConnection) 在values中到底是绑定表单中的input name还是绑定什么值?
输入input name老是提示未声明名称"+type+"这样!
控件ID.Text
如果是HTML的服务控年的话,应该输入
控件ID.Value
<input id="userTelephone" name="email" runat="server" maxlength="13"/>
获取控件中的值:userTelephone.value
<%@ Import Namespace="System.Data" %>
<%@ Import NameSpace="System.Data.OleDb" %>
<script laguage="VB" runat="server">
Dim myConnection As OleDbConnection
Dim myCommand As OleDbCommand
sub page_load(sender as Object,e as EventArgs) dim dbname as string
dbname=server.mappath("db1.mdb")
myConnection = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source="&dbname )
myConnection.Open()
myCommand = New OleDbCommand("Insert INTO jqpt(c_date,c_type) Values("+date+","+type+")", myConnection)
myCommand.ExecuteNonQuery()
la2.Text = "提交成功,谢谢!"
myConnection.Close()
end sub
</script>
<html>
<body>
<asp:label id="la2" runat="server" /><br>
</body>
</html>
myCommand = New OleDbCommand("Insert INTO jqpt(c_date,c_type) Values("+date.Text+","+type.Text+")", myConnection)