Re: Looping through table names in a DataSet. Is this possible?
Dan Weese <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.cx |
|---|---|
| Message-ID | <[email protected]> |
Thanks! ----- Original Message ----- From: "Shawn Wildermuth" <[email protected]> To: <[email protected]> Sent: Wednesday, May 31, 2006 1:34 PM Subject: Re: [DOTNET-CX] Looping through table names in a DataSet. Is this possible? > Yes, just add a 'Component' to your project. YOu'll get a class that will > be the design surface. I explain it for 1.1 in detail here: > > http://adoguy.com/viewrant.aspx?id=1457 > > Thanks, > > Shawn Wildermuth > http://adoguy.com > C# MVP, MCSD.NET, Author and Speaker > > > > > -----Original Message----- > From: Discussion relating to the specifics of the C# and Managed C++ > languages [mailto:[email protected]] On Behalf Of Dan Weese > Sent: Wednesday, May 31, 2006 2:09 PM > To: [email protected] > Subject: Re: [DOTNET-CX] Looping through table names in a DataSet. Is this > possible? > > Does all that work without having a form in your project? The data layer > of > our application doesn't have any UI. Will the Data Designers work in an > environment where there aren't any user interface items? > > Dan > > ----- Original Message ----- > From: "Adrian Martin" <[email protected]> > To: <[email protected]> > Sent: Wednesday, May 31, 2006 9:50 AM > Subject: Re: [DOTNET-CX] Looping through table names in a DataSet. Is this > possible? > > > There are a couple of ways to invoke the Data Designers, if you have set > up > data connections in the server explorer, twist open the connection and > then > the tables, then just drag the table you want onto a form or component, VS > will then create a connection,and a dataadater for the table you dragged, > you can then right click the dataadapter and create a typed dataset as > well( > including the table mappings). Or just drop a DataAdapter onto a Form from > the 'Data' pain of the Toolbox and follow the wizard. > > Its worth changing the default names as you go along. You can also change > the select statement, eg add parameters to the queries by selecting the > dataadapters properties twist open the SelectCommand Properties, hilight > the > CommandText property and click the ellipses that appear next to the > command > text. > > They are really worth playing around with and getting used to, because > they > can save a lot of time...they do a lot of work for you espcially the > TableMappings bit....... > > > > > > -----Original Message----- > From: Discussion relating to the specifics of the C# and Managed C++ > languages [mailto:[email protected]] On Behalf Of Dan Weese > Sent: 31-05-2006 15:26 > To: [email protected] > Subject: Re: Looping through table names in a DataSet. Is this possible? > > So is it just a matter of using the Fill command once with each > DataAdapter, > referencing the same DataSet? > >>>( Something tells me you are avoiding the Designers !) > > Also, which Designer are you referring to? > > Dan > ----- Original Message ----- > From: "Adrian Martin" <[email protected]> > To: <[email protected]> > Sent: Wednesday, May 31, 2006 8:43 AM > Subject: Re: [DOTNET-CX] Looping through table names in a DataSet. Is this > possible? > > > With four separate DataAdpaters, each with its TableMappings Collection > configured properly. > > ( Something tells me you are avoiding the Designers !) > > -----Original Message----- > From: Discussion relating to the specifics of the C# and Managed C++ > languages [mailto:[email protected]] On Behalf Of Dan Weese > Sent: 31-05-2006 14:29 > To: [email protected] > Subject: Re: Looping through table names in a DataSet. Is this possible? > > OK, I'm very new at this. I understand what you're saying, but I don't > know > how to do it. How do I get 4 separate select statements into one dataset? > > Dan > > ----- Original Message ----- > From: "Hewitt, Simon C. (Contractor)" <[email protected]> > To: <[email protected]> > Sent: Tuesday, May 30, 2006 11:13 PM > Subject: Re: [DOTNET-CX] Looping through table names in a DataSet. Is this > possible? > > > Dan > > One select command=one resulting table. > If you are expecting 4 tables then you would need to load the dataset with > 4 > select commands. > > Cheers > Simon > > -----Original Message----- > From: Discussion relating to the specifics of the C# and Managed C++ > languages [mailto:[email protected]] On Behalf Of Dan Weese > Sent: 30 May 2006 20:19 > To: [email protected] > Subject: [DOTNET-CX] Looping through table names in a DataSet. Is this > possible? > > I'm trying to get a Crystal Reports class working so I can pass a DataSet > to > replace the one used on the report. The method in the Crystal code loops > through the table names to make sure they all match what is already on the > report. What's happening is, when I get my DataSet, it's assigning a > table > name to the entire query, thereby showing that there is only 1 table > rather > than 4. > > Is there a way to bypass this table naming? The basics of my code are: > > DataSet ds = new DataSet(); > > SqlDataAdapter da = new SqlDataAdapter(); > > da.SelectCommand=command; > > connection.Open(); > > da.Fill(ds,"ReportData"); > > Is there something I can do instead of this to be able to see each > individual table? Even if I remove the "ReportData" and just use > "da.Fill(ds);" it still names it "Table". > > Thanks. > > Dan Weese > [email protected] <mailto:[email protected]> > > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > > > > > Opinions expressed in this email are those of the writer and not the > company. E-mail traffic is monitored within Johnston Press and messages > may > be viewed. This e-mail and any files with it are solely for the use of > the > addressee(s). If you are not the intended recipient, you have received > this > e-mail in error. Please delete it or return it to the sender or notify us > by email at [email protected] > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > > > > > Opinions expressed in this email are those of the writer and not the > company. E-mail traffic is monitored within Johnston Press and messages > may > be viewed. This e-mail and any files with it are solely for the use of > the > addressee(s). If you are not the intended recipient, you have received > this > e-mail in error. Please delete it or return it to the sender or notify us > by email at [email protected] > > =================================== > This list is hosted by DevelopMentorR http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentorR http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor® http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com