[VB.NET]請大家幫忙!!!select delete insert button 問題

VB.NET源码-156个实用实例哦…… 請大家幫忙!!!select delete insert button 問題
http://space.uwants.com/batch.download.php?aid=490130

select button 在不load database 的時候 按下去 error
delete button 在不load database 的時候 按下去 error
insert button 在不load database 的時候 按下去 error

已上應該是出現問題的.

上面是我的 測試版 請大家看看那裡錯了.. <用的是 vb.net 2005+access+dataset>
請幫忙改..

我e-mail是:lck0328@hotmail.com

thx!!!!!!!感激不盡!!!!!!!
__________________________________________________________________________
连不上啊。
__________________________________________________________________________
1.
Private Sub btnSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelect.Click
If txt1.Text = Then
MessageBox.Show( Error! )
Else
DMLDataGrid( select * from members where Membership_name= & _
txt1.Text & ORDER BY Membership_number )
End If

txt1.Text & order by Membership_number 123 )

DMLDataGrid( SELECT * FROM members WHERE Membership_name = & _
txt1.Text & ORDER BY Membership_number ASC )
End Sub


2.
Sub DMLDataGrid(ByVal sqlStr As String)
Declare and populate the data table
Dim dt As New DataTable()
Dim connStr As String = Provider = Microsoft.Jet.OLEDB.4.0; & _
Data Source = + Application.StartupPath() + /Resort.mdb
Dim dataAdapter As New OleDb.OleDbDataAdapter(sqlStr, connStr)
dataAdapter.Fill(dt)
dataAdapter.Dispose()
DataGrid1.DataSource = Dsmembers1.Members
DataGrid1.DataSource = Dsmembers1.Members.Membership_numberColumn
Display the names of the cities in the specified country
MsgBox( The record has been updated. )
End Sub
__________________________________________________________________________
回覆樓2
剛測試 下載的 LINK 沒問題 ...QQ.請再下載多1次看看!

http://space.uwants.com/batch.download.php?aid=490130
__________________________________________________________________________
回覆:dutguoyi(新鲜鱼排)

SELECT 的時候 打入數字 是全部 SHOW 了出來...
~_~我想要的是在TEXTBOX打入數字 1.(橫行) 只出那人的資料而已.
剛試了.打1字 就全部 資料 出來了.不是個人的資料!QQ
__________________________________________________________________________
~_~我要的是..沒打資料之前.按一下 select button 會跳出句字說 *(&*^&
在打入數字之後 只要那1個人的資料.沒其他人的資料出現...

謝謝各位!!!!!!!
__________________________________________________________________________
1.
Sub DMLDataGrid(ByVal sqlStr As String)
Declare and populate the data table
Dim dt As New DataTable
Dim connStr As String = Provider = Microsoft.Jet.OLEDB.4.0; & _
Data Source = + Application.StartupPath() + /Resort.mdb
Dim dataAdapter As New OleDb.OleDbDataAdapter(sqlStr, connStr)
dataAdapter.Fill(dt)
dataAdapter.Dispose()
DataGrid1.DataSource = dt 为什么是另外一个数据集,Fill(dt)
DataGrid1.DataSource = Dsmembers1.Members.Membership_numberColumn
Display the names of the cities in the specified country
MsgBox( The record has been updated. )
End Sub

2. 在窗体上要填写Member Number为什么过滤条件是Membership_name=,还有Membership_number是Number类型,为什么用Membership_name= 这样的定义方式,分清字符串和整型的定义区别。
Private Sub btnSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelect.Click
If txt1.Text = Then
MessageBox.Show( Error! )
Else
DMLDataGrid( select * from members where Membership_number= & _
txt1.Text & ORDER BY Membership_number )
End If

txt1.Text & order by Membership_number 123 )

DMLDataGrid( SELECT * FROM members WHERE Membership_name = & _
txt1.Text & ORDER BY Membership_number ASC )
End Sub
__________________________________________________________________________
謝謝你的幫忙.............
__________________________________________________________________________
回覆dutguoyi(新鲜鱼排)


Sub DMLDataGrid(ByVal sqlStr As String)
Declare and populate the data table
Dim dt As New DataTable
Dim connStr As String = Provider = Microsoft.Jet.OLEDB.4.0; & _
Data Source = + Application.StartupPath() + /Resort.mdb
Dim dataAdapter As New OleDb.OleDbDataAdapter(sqlStr, connStr)
dataAdapter.Fill(dt)
dataAdapter.Dispose()
DataGrid1.DataSource = dt 为什么是另外一个数据集,Fill(dt)
DataGrid1.DataSource = Dsmembers1.Members.Membership_numberColumn
Display the names of the cities in the specified country
MsgBox( The record has been updated. )
End Sub
上面這句 如果DELETE 了就會出現問題..
__________________________________________________________________________
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页