制作类库(dll) [英] making Class Libarary (dll)

查看:86
本文介绍了制作类库(dll)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为具有多个参数的函数制作一个dll
其中一个参数用于表示datagridview的名称
如果我以字符串形式传递名称,则表明无法将数据源分配给字符串

i wanted to make a dll for a function with multiple parameters
in that one parameter is for name of datagridview
if i pass the name in string it shows that datasource could not be assigned to string

adp = New SqlDataAdapter("select CId,SrNo,Date,Name,Contact,Contact1,ResNumber,DOB,Age,Location,Qualification,CurrentOrganizatn,WorkExp,CalledBy,EQId,SentTo,HRStatus,Process,SentTo1,HRStatus1,Process1,SentTo2,HRStatus2,Process2,SentTo3,HRStatus3,Process3,SentTo4,HRStatus4,Process4,Remark,Remark1 from TotTab where convert(datetime,Date,105) between convert(datetime,''" + DispatchFrom + "'',105) and convert(datetime,''" + DispatchTo + "'',105) and SentTo=''" + offerCb + "''   and HRStatus like ''rej%'', con)



在其他情况下,如果我想将该数据集用作其他项目上的数据源,则表明该数据集未定义



in other case if i want to use that dataset as datasource on other project it shows that dataset not defined

Private Sub DispatchBtn_Click(sender As System.Object, e As System.EventArgs) Handles DispatchBtn.Click

       Dim Hi As New dispatched.Class1
       Hi.selectDispatch(offerCb.Text, DispatchFrom.Text, DispatchTo.Text, My.Settings.Equation1ConnectionString)
       DispatchGrid.DataSource = Hi.ds1.Tables(0)
  
End Sub




我如何通过它可以为我提供一些帮助..




how can i pass it can some 1 help me..

推荐答案

您无法访问 Hi.ds1 之类的数据集.而是从DLL返回数据集,并将其分配给页面上定义的另一个对象.

您不能将gridview直接传递给.dll.您需要导入 System.Windows.Forms 的命名空间.
不要将gridview传递给dll.而是通过数据集.
You can not access dataset like Hi.ds1. instead return dataset from DLL and assign it in another object which is defined on page.

You can''t pass gridview to .dll directly. you need to import namespace of System.Windows.Forms.
don''t pass gridview to dll. pass dataset instead.


这篇关于制作类库(dll)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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