这是我的代码
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim ydzs As String = "select count(ydcid) from sj_jesjb where fzm='" + hzzm_dt.SelectedValue + "'"
Dim ktsl As String = "select count(ktbz) from sj_jesjb where fzm='" + hzzm_dt.SelectedValue + "' and ktbz='1'"
Dim jehj As String = "select sum(jfje) from sj_jesjb where fzm='" + hzzm_dt.SelectedValue + "'"
Dim Strqssj, Strjzsj As String
Strqssj = bdate1.Text
Strjzsj = bdate2.Text
Dim tj As String = "insert into tj_zcje(fzh,fzm,qssj,jzsj,tjydzs) values('" + zmlm_dt.SelectedValue + "','" + hzzm_dt.SelectedValue + "',to_date('" + Strqssj + "','yyyy-mm-dd'),to_date('" + Strjzsj + "','yyyy-mm-dd'),' " + ydzs + "')"
Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand(tj, myconn)
cmd.Connection.Open()
cmd.CommandText() = tj
cmd.ExecuteNonQuery()
cmd.Connection.Close()
Response.Write("<script language='JAVAScript'>alert('数据统计完成');</script>")
dg1_bind()
End Sub
后面还有两个字段没有加进去,加上ydzs 这个变量就提示错误 ora-00917缺少逗号