将参数分配给sqldatadapter [英] assign parameter to an sqldatadapter

查看:85
本文介绍了将参数分配给sqldatadapter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我有一个主明细/表,其中明细有一个blob字段.由于数据量很大,当我导航到最后一条记录时,内存出现错误(我认为它加载了数据并且无法清除以前的记录缓存吗?).因此,我尝试使用第二个dataadapter和一个参数来完成此操作,该参数(用于明细表)通过文本框(主参数指向明细表外键)通过文本框获取主表的主键,适配器我输入了一个有效的数字,然后我得到了数据,问题是当我编码插入值时,我没有数据

Hello,
I have a master detail/table in which the detail has a blob field. Due to a large ammount of data I get an error out of memory when I navigate to the last records (I think it loads the data and can''t clear the previous records cache?). So I tried to do it with a second dataadapter and a parameter, which parameter (for the detail table) takes the primary key of the master table through a textbox (the paramater points to the detail table foreign key), on the preview of the adapter I enter a valid number and I get the data, the problem is when I coded to insert the value I get no data

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.SqlDataAdapter1.Fill(DataSet11, "Table1")
    Me.SqlDataAdapter2.SelectCommand.Parameters(0).Value = convert.int32(TextBox1.Text)
    Me.SqlDataAdapter2.Fill(DataSet21, "scan")
  end Sub





谢谢
Kyriakos





Thank you
Kyriakos

推荐答案

看起来像您要查看一个子集. DataView可以帮助您.看看更多信息的链接:
http://msdn.microsoft.com/en-us/library/system.data. dataview.aspx [^ ]

祝你好运!
Looks like you want to view a subset. A DataView could help you out. Have a look at the link for more info:
http://msdn.microsoft.com/en-us/library/system.data.dataview.aspx[^]

Good luck!


第一条记录中的数据没有明细表数据.我不会输入完整的代码,但是可以.
There was data in the first record had no detail table data. I will not enter the entire code but works.


这篇关于将参数分配给sqldatadapter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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