在VB.net中移动记录 [英] Move record in VB.net

查看:115
本文介绍了在VB.net中移动记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,所有访客.
我在将记录移至下一个记录时遇到问题.
我有4个按钮(第一个,上一个,下一个,最后一个).
我使用sql bindingsource.when加载窗体时,我不显示任何数据到文本框.
并且比我想将记录移至下一条记录.但是当我单击下一步"按钮时,它会警告消息对象未设置.........).

我该如何解决这个问题?

(注意:如果我在加载表单时将数据填充到文本框中并移动下一步,就可以了,但是我不想在加载表单时填充数据)

最好的问候,

Hi all visitors.
I have problem with moving record to next record.
i have 4 buttons( first,previous,next,last).
i used sql bindingsource.when the form loaded, i dont display any data to text box.
and than i want to move the record to next record. but when i click Next Button, it alerts a message "Object not set............).

How can i solve that problem?

(Note: if i fill data to text box at form loaded and move Next, it is ok. but i dont want to fill data at form loaded)

Best Regards,

推荐答案

尝试此链接...

http://www.codeproject.com/KB/grid/BindSourceBindingNavCS.aspx
Try this link...

http://www.codeproject.com/KB/grid/BindSourceBindingNavCS.aspx


解决问题
作者:-Jaysing Chavda
Solve Problem
by :-Jaysing Chavda
connetionString = "Data Source=SOFT05-PC;Initial Catalog=Demo;User ID=sa;Password=sa123"
        da = New SqlDataAdapter("Select * From Test", connetionString)
        Dim ds As New DataSet
        da.Fill(ds)
        bm = Me.BindingContext(ds, "Demo")
        dr = ds.Tables(0).Rows(ds.Tables(0).Rows.Count - 1)
        TextBox1.Text = dr(0)
        TextBox2.Text = dr(1)
        TextBox3.Text = dr(2)
        TextBox4.Text = dr(3)
        TextBox5.Text = dr(4)


解决问题
作者:-Jaysing Chavda
Solve Problem
by :-Jaysing Chavda
connetionString = "Data Source=SOFT05-PC;Initial Catalog=Demo;User ID=sa;Password=sa123"
        da = New SqlDataAdapter("Select * From Test", connetionString)
        Dim ds As New DataSet
        da.Fill(ds)
        bm = Me.BindingContext(ds, "Demo")
        dr = ds.Tables(0).Rows(ds.Tables(0).Rows.Count - 1)
        TextBox1.Text = dr(0)
        TextBox2.Text = dr(1)
        TextBox3.Text = dr(2)
        TextBox4.Text = dr(3)
        TextBox5.Text = dr(4)


这篇关于在VB.net中移动记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆