您的位置:程序门 -> .net技术 -> vb.net



請大家幫忙!!!select delete insert button 問題


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


請大家幫忙!!!select delete insert button 問題
发表于:2007-05-01 01:34:24 楼主
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!!!!!!!感激不盡!!!!!!!
发表于:2007-05-01 01:38:311楼 得分:0
连不上啊。
发表于:2007-05-01 09:43:432楼 得分:0
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
发表于:2007-05-01 18:36:483楼 得分:0
回覆樓2  
剛測試   下載的   link   沒問題   ...qq.請再下載多1次看看!

http://space.uwants.com/batch.download.php?aid=490130
发表于:2007-05-01 18:54:314楼 得分:0
回覆:dutguoyi(新鲜鱼排)

select   的時候   打入數字   是全部   show   了出來...
~_~我想要的是在textbox打入數字   1.(橫行)   只出那人的資料而已.
剛試了.打1字   就全部   資料   出來了.不是個人的資料!qq
发表于:2007-05-01 19:07:525楼 得分:0
~_~我要的是..沒打資料之前.按一下   select   button   會跳出句字說 "*(&*^& "
在打入數字之後   只要那1個人的資料.沒其他人的資料出現...

謝謝各位!!!!!!!
发表于:2007-05-02 08:14:016楼 得分:0
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
发表于:2007-05-03 00:13:417楼 得分:0
謝謝你的幫忙.............
发表于:2007-05-04 23:23:508楼 得分:0
回覆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   了就會出現問題..



快速检索

最新资讯
热门点击