强类型数据集问题 [英] Strongly type dataset issue

查看:81
本文介绍了强类型数据集问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我遇到了已添加到项目中的类型化数据集的问题。出于某种原因,当代码到达fill命令时:

 Me.UsersTableAdapter1.Adapter.SelectCommand = dd3'.CommandText = SqlUsers 
me .UsersTableAdapter1.Connection = OpenConnection
Me.UsersTableAdapter1.Fill(WA_MMTP_TrackerDataSet1.Users)

我得到一个" 对象引用未设置为对象的实例"错误。   我是数据集中的断点填充代码:

公共重载可覆盖函数填充( ByVal dataTable As WA_MMTP_TrackerDataSet1.UsersDataTable)As Integer 
Me.Adapter.SelectCommand = Me.CommandCollection(0)
If(Me.ClearBeforeFill = true)Then
dataTable.Clear
End如果
Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
返回returnValue
结束函数

它出错在Me.Adapter.Fill(dataTable)行上。为什么会这样呢?有点令人沮丧,因为这是从VS 2013生成的类型化数据集。感谢您的帮助。


Michael

解决方案

< blockquote>

是的但是什么是Me.Adapter,我认为它不是实例,也不是它的实例。


Hi All,

I'm having an issue with a typed dataset that Ive added to my project. For some reason when the code get to the fill command:

 Me.UsersTableAdapter1.Adapter.SelectCommand = dd3  '.CommandText = SqlUsers
me.UsersTableAdapter1.Connection = OpenConnection
Me.UsersTableAdapter1.Fill(WA_MMTP_TrackerDataSet1.Users)

I get a "object reference not set to an instance of a object" error.  I but a break point in the dataset Fill code:

 Public Overloads Overridable Function Fill(ByVal dataTable As WA_MMTP_TrackerDataSet1.UsersDataTable) As Integer
Me.Adapter.SelectCommand = Me.CommandCollection(0)
            If (Me.ClearBeforeFill = true) Then
                dataTable.Clear
            End If
 Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
 Return returnValue
End Function

It errors out on the Me.Adapter.Fill(dataTable) line. Why is this happening. A little frustrating since this is a typed dataset generated from VS 2013. Thanks for any help.

Michael

解决方案

Yea but what is Me.Adapter, I don't see it instanced, neither what it is.


这篇关于强类型数据集问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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