关于vb.net的数据读取有关问题 求高手给点帮助 小弟我实在是不会了!
关于vb.net的数据读取问题 求高手给点帮助 我实在是不会了!!!!!!!!!
Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings( "strConn "))
Dim sql As String = "select * from 月份数据动态表 where 年 = " & Year(Now) & " and 月 = " & Month(Now)
Dim comm As SqlCommand = New SqlCommand(sql, conn)
conn.Open()
Dim rs As SqlDataReader = comm.ExecuteReader()
这是我的程序的开头 我想实现读上一条记录 还有读下一条 分别怎么写
希望大家帮忙啊!!!!!!!!
数据库连接上了 但是发现程序没法保存了 看了程序不知道那里出了问题 现在把保存那部分代码写出来望高手讲解修改 我用的是vb.net。。
Protected Sub abc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles abc.Click
If Session( "safepage_exist ") = 0 Then
If dieg.Text = " " Or diew.Text = " " Or gbhg.Text = " " Or gbhw.Text = " " Or boog.Text = " " Or boow.Text = " " Or firez.Text = " " Or firey.Text = " " Or envirz.Text = " " Or enviry.Text = " " Then
msg.Text = "请将信息填写完整! "
Return
End If
Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings( "strConn "))
conn.Open()
Dim strSelect As String = "select * from 月份数据动态表 where 企业名称= ' " & Session( "企业名称 ") & " ' and 年 = " & Year(Now) & " and 月 = " & Month(Now)
Dim adp As New SqlDataAdapter(strSelect, conn)
Dim ds As New DataSet()
adp.Fill(ds, "月份数据动态表 ")
Dim dt As DataTable = ds.Tables( "月份数据动态表 ")
Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings( "strConn "))
Dim sql As String = "select * from 月份数据动态表 where 年 = " & Year(Now) & " and 月 = " & Month(Now)
Dim comm As SqlCommand = New SqlCommand(sql, conn)
conn.Open()
Dim rs As SqlDataReader = comm.ExecuteReader()
这是我的程序的开头 我想实现读上一条记录 还有读下一条 分别怎么写
希望大家帮忙啊!!!!!!!!
数据库连接上了 但是发现程序没法保存了 看了程序不知道那里出了问题 现在把保存那部分代码写出来望高手讲解修改 我用的是vb.net。。
Protected Sub abc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles abc.Click
If Session( "safepage_exist ") = 0 Then
If dieg.Text = " " Or diew.Text = " " Or gbhg.Text = " " Or gbhw.Text = " " Or boog.Text = " " Or boow.Text = " " Or firez.Text = " " Or firey.Text = " " Or envirz.Text = " " Or enviry.Text = " " Then
msg.Text = "请将信息填写完整! "
Return
End If
Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings( "strConn "))
conn.Open()
Dim strSelect As String = "select * from 月份数据动态表 where 企业名称= ' " & Session( "企业名称 ") & " ' and 年 = " & Year(Now) & " and 月 = " & Month(Now)
Dim adp As New SqlDataAdapter(strSelect, conn)
Dim ds As New DataSet()
adp.Fill(ds, "月份数据动态表 ")
Dim dt As DataTable = ds.Tables( "月份数据动态表 ")