Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / August 2005

Tip: Looking for answers? Try searching our database.

Problem creating "n" DataViews

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pablo - 19 Aug 2005 04:44 GMT
Hi people,

Necesito crear n dataviews en tiempo de ejecucion.
I need to create "n" DataViews in runtime.

I tried creating an array this way:

Dim LDView As Array = Array.CreateInstance(GetType(DataView), 10)

DSCapit = New DataSet("DS")
LGCap = New DataTable("DT")

Dim cACCOUNT As DataColumn
cACCOUNT = New DataColumn("ACCOUNT")

LGCap.Columns.Add(cACCOUNT)
DSCapit.Tables.Add(LGCap)

but the asignation is not working:

lDView(0) = New DataView(LGCap) '(1)

neither this way :
lDView.SetValue(New DataView(LGCap), 0)  '(2)

This two way compilate but then cancel in runtime
in the array asignacion line (1) y (2)

The problem came from my need to create a tabcontrol with
"n" (variable) tabs within it, according to a database table
contents. And within each tab one datagrid with its corresponding
DataView, all created in runtime.

Any ideas?

TIA
Pablo
Cor Ligthert [MVP] - 19 Aug 2005 10:58 GMT
Pablo,

Is this what you want, otherwise describe what why you need those dataviews?

Dim LDView(myTabControl.tabcount) As DataView
Dim DSCapit As New DataSet("DS")
Dim LGCap As New DataTable("DT")
LDView(0) = New DataView(LGCap) '(1)

I hope this helps,

Cor
Cor Ligthert [MVP] - 19 Aug 2005 11:12 GMT
Pablo,

Forget this part in the sentence from me. When I was answering your question
I had seen you did that,  therefore I could make this snippet. However
forget to delete this. Your problem was well described.

> describe what why you need those dataviews?

Cor

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.