为什么这里老是提醒我标准数据类型不匹配?代码如下
ProtectedSubButton1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton1...
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myconnection As OleDbConnection
Dim mycnstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("App_data/db1.mdb")
myconnection = New OleDbConnection(mycnstr)
Dim sql As String = ""
Dim myxb As Boolean = False
If (RadioButtonList1.SelectedValue = "男") Then
myxb = True
Else
myxb = False
End If
sql = "insert into 招聘信息(姓名,性别,年龄,学历,联系方式,工作经历) values('" & xm.Text & "','" & myxb & "','" & nl.Text & "','" & xl.Text & "','" & lxfs.Text & "','" & gzjl.Text & "')"
Dim mycom As OleDbCommand
myconnection.Open()
mycom = New OleDbCommand
mycom = New OleDbCommand(sql, myconnection)
mycom.ExecuteNonQuery()
myconnection.Close()
Response.Write("<script language='javascript'>alert('提交成功!');</script>")
End Sub 展开
Dim myconnection As OleDbConnection
Dim mycnstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("App_data/db1.mdb")
myconnection = New OleDbConnection(mycnstr)
Dim sql As String = ""
Dim myxb As Boolean = False
If (RadioButtonList1.SelectedValue = "男") Then
myxb = True
Else
myxb = False
End If
sql = "insert into 招聘信息(姓名,性别,年龄,学历,联系方式,工作经历) values('" & xm.Text & "','" & myxb & "','" & nl.Text & "','" & xl.Text & "','" & lxfs.Text & "','" & gzjl.Text & "')"
Dim mycom As OleDbCommand
myconnection.Open()
mycom = New OleDbCommand
mycom = New OleDbCommand(sql, myconnection)
mycom.ExecuteNonQuery()
myconnection.Close()
Response.Write("<script language='javascript'>alert('提交成功!');</script>")
End Sub 展开
1个回答
展开全部
请把sql = "insert into 招聘信息(姓名,性别,年龄,学历,联系方式,工作经历) values('" & xm.Text & "','" & myxb & "','" & nl.Text & "','" & xl.Text & "','" & lxfs.Text & "','" & gzjl.Text & "')"
中的myxb,改成myxb.ToString,问题应该错在这里.
因为mdb数据库字段,没有Boolean属性.
中的myxb,改成myxb.ToString,问题应该错在这里.
因为mdb数据库字段,没有Boolean属性.
来自:求助得到的回答
美林数据技术股份有限公司
2020-10-29 广告
2020-10-29 广告
Tempo大数据分析平台,它是一款集数据接入、数据处理、数据挖掘、数据可视化、数据应用于一体的软件产品。它秉持“智能、互动、增值”的设计理念,面向企业级用户提供自助式数据探索与分析能力,为企业提供从BI到AI的一体化数据分析与应用解决方案。...
点击进入详情页
本回答由美林数据技术股份有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询