ADO.NET General Discussion

Posted February 19, 2003

Chat Date: January 28, 2003

Please note: Portions of this transcript have been edited for clarity

Chat Participants:

  • David Sceppa, Software Design Engineer
  • Karol Zadora-Przylecki, Software Design Engineer
  • Steve Stein, Programmer/Writer
  • Ed Hickey, Program Manager

Moderator: Ed H (Microsoft)
Welcome to today’s general discussion chat on ADO.NET. We have members of the VB and Webdata development teams here to answer your questions today. I will ask the hosts to introduce themselves.

Host: Dave Sc (Microsoft)
My name is David Sceppa. I work with the data access development team at Microsoft. I'm also the author of Microsoft ADO.NET, available through Microsoft Press.

Host: Karolz (Microsoft)
I am Karol, a developer in the Visual Studio Data Design Time team.

Host: Steve (Microsoft)
Hi all - I'm Steve a Programmer/Writer on the VB .NET Team.

Moderator: Ed H (Microsoft)
And I am Ed Hickey, VB Communities PM. Glad you all could make it today!

Moderator: Ed H (Microsoft)
Let's get started! Fire away with your questions for our hosts.

Moderator: Ed H (Microsoft)
We also have one of our distinguished MVP's here today, I'll ask him to introduce himself in the bottom window

Host: Dave Sc (Microsoft)
Q: I'm wondering why in a typed Dataset, the metaData columns i.e. OrderIDColumn are defined as internal.

A: The strongly-typed DataSet maintains references to columns to improve the performance of the code you write to access the contents of the row.

Host: Karolz (Microsoft)
Q: What about design time binding to this component? IList? IListSource? IBindableList? Confused. Thks

A: The typed dataset inherits from System.Data.DataSet, so you get IListSource implementation for free. You should be able to bind to it just like to and untyped DataSet.

Host: Karolz (Microsoft)
Q: But it's a private member variable of the component so it's not propagated through - and I don't want them to bind to the master table directly

A: Oh, I see. Well, implementing IList should give you basic binding support. If the properties available for binding should differ from public properties of the object you should implement ITypedList.

Host: Karolz (Microsoft)
Q: Do you think I need to implement IListSource to expose the child datatable though?

A: You implement IListSource if, for some reason, you don't want your object to implement IList (or ITypedList) directly. It is not essential for binding to work, though.

Host: Karolz (Microsoft)
Q: Are you speaking in terms of DesignTime binding or runtime binding? Is there a good example of when I might implement IListSource.

A: Both, actually. Visual Studio doesn't use anything else than IList + ITypedList + reflection at design time. I haven't found any example that would show you how to implement IListSource/ITypedList on MSDN. I noticed there are some examples available on the Internet, but I don't know how good they are.

Host: Steve (Microsoft)
Q: I get a LogonFailed when trying to export a crystal reports report to PDF. This does not seem to happen when the report is populated from within the report, but happens when i use a dataset to populate the report

A: Not really sure but for Crystal Reports issues you can check out https://support.crystaldecisions.com

Host: Steve (Microsoft)
Q: I would have appreciated (and still would, I guess) an article describing the differences between "classic" ADO and ADO.NET. I had trouble when I first used ADO.NET, since it was quite different. Some kind of transition manual would have helped.

A: There is a topic on MSDN that compares ADO and ADO.NET at: https://msdn.microsoft.com/library/en-us/vbcon/html/vbconadopreviousversionsofado.asp

Host: Steve (Microsoft)
Q: Thanks Steve, but that site is about as much help as standing in dark room with your head in a bag. Crystal Decision has done a terrible job of preparing for using Visual Studio .NET

A: The public newsgroup on Crystal and VB may be a better alternative then: microsoft.public.vb.crystal

Host: Dave Sc (Microsoft)
Q: I have a problem with Expression columns in datasets. They work great until you try to issue a DA update, and then you get a Proposed changes error. Is there a fix for this, or will there be? Until then, what's the best way to update a datasource?

A: This is a known problem that will be addressed in a future version of ADO.NET. If you've tried running similar code against the v1.1 public beta and still see the problem, please let us know via the newsgroups.

Host: Dave Sc (Microsoft)
Q: I would have liked to use those columns in my Business Layer assembly or my UI layer - but I can't since they are in another assembly.

A: While there isn't a switch on the strongly-typed DataSet utility, there's nothing preventing you from changing the code once it's been generated to get the desired access level.

Moderator: Ed H (Microsoft)
Q: In ref to the expression columns, I haven't downloaded 1.1 beta.. I'll have to try it and see if it fixes the problem. Do you feel that 1.1 is stable enough to pop on a production box? If not, when will 1.1 or later go release?

A: We can't, of course, say when we are shipping, but I will say that the current downloadable Framework is the "final Beta", so it's close.

Moderator: Ed H (Microsoft)
Q: Thanks for the answer Ed_H_MS.. I'll try the beta and see if it works! What does it do now in 1.1, ignore the expression columns? Or do I need to change some property of the column to make it ignore?

A: I'm not really sure, I'm not a "data guy", sorry. We can't comment on an unreleased product anyway, the lawyers would have us for lunch!

Host: Dave Sc (Microsoft)
Q: Hi, I’ve been having lots of trouble getting FoxPro tables to update in ADO.net. I dislike the Disconnected approach in ADO.NET is there anyway to have it stay connected to the source and not have to use command builder like 2.6 did?

A: ADO.NET's current updating story focuses on disconnected optimistic concurrency through INSERT, UPDATE, and DELETE queries rather than performing updates through cursors. You should be able to use ADO.NET in conjunction with a FoxPro ODBC driver or OLE DB provider.

Host: Steve (Microsoft)
Q: I have a question for the hosts...i need to write a web service that manipulates data in an access db...this works fine from vb.net/asp.net apps, but get oledb exception on the .Open() method when called from a web method...why?

A: It sounds like a permissions issue. On the machine with the web service does the ASPNET account have permission to access the Access db?

Host: Dave Sc (Microsoft)
Q: Okay - touche. I was just hoping to get a rationale statement on the declaration of Internal on these to tell my students.

A: My guess is that the developers who created the strongly-typed DataSet generator wanted to make sure that developers did not accidentally modify the DataColumns in a way that would cause problems for the strongly-typed DataSet's code

Host: Dave Sc (Microsoft)
Q: BetaV : Okay MS guys... how about this: What happened to the FoxPro provider etc. we saw in the early betas for VS 1.0?

A: I believe that provider became part of Visual FoxPro 7.0.

Host: Dave Sc (Microsoft)
Q: Hope this is not OT. Tried to connect to SQL Svr Dev Ed from ASP.NET page. Err msg said not a trusted user. Do I have to reinstall SQL Svr? I'm not part of a domain.

A: That version of SQL Server is configured to allow only trusted connections initially. When you connect to the database at design-time or through a Windows application, you're attempting to connect using your own security access. When you're connecting from an ASP.NET page, it's actually the ASPNET account that's attempting to connect to the database. You can grant connect access to the ASPNET account by calling stored procedures on the database. See SQL Server Books OnLine for more information.

Host: Karolz (Microsoft)
Q: How to I make my business object with public properties support design time binding in Windows Forms. It has public properties, but they don't show up in the drop down for any of the bindable properties - on say either a textbox or a datagrid

A: Your component needs to implement either IList or IListSource.

Moderator: Ed H (Microsoft)
Q: In the postback of an ASP.NET control - is it possible to find out the bindings for a control such as a textbox? I can't see any way to find out what it was bound to.

A: You should be able to see what it is bound to by looking at the DataSource attribute of the control.

Host: Steve (Microsoft)
Q: Is it good practice to throw an exception in the set accessor for a public property that may be bound to in a Windows Form? Is that the best way to do validation?

A: It depends on what you are validating for. Trying to set to an invalid type will automatically throw an exception. Validating a range of 'valid' values will restrict all instances to that criteria. I suggest to perform validation in the Binding.Format event handler, this way you can present a string in a text box that's bound to a null value for example.

Host: Karolz (Microsoft)
Q: Will ASP.NET controls ever support two-way databinding like Windows Forms controls do?

A: Yes, we are working on that.

Host: Dave Sc (Microsoft)
Q: Will ASP.NET controls ever support two-way databinding like Windows Forms controls do?

A: Keep in mind that with a Web page, it's a completely different architecture. The ASP.NET controls generate HTML that's sent to the browser along with directions on how to return that information to the server.

Host: Dave Sc (Microsoft)
The ASP.NET team is looking at ways to provide more of the look and feel of WinForms data-binding. They've done a great job simplifying the process, though there's always room for improvement. I'd really recommend reading a book or three on building ASP.NET applications to better understand the architecture and ensure that you're building solutions that will perform well as the number of users accessing your site increases.

Host: Steve (Microsoft)
Q: Sorry, just saw your post up there...yeah, the ASPNET acct does have full access to the AccessDB...which is why i can't figure it out!

A: Can the web service access it at all or does it error after the 2nd query? ... could it be a locking problem?

Host: Steve (Microsoft)
Q: After setting the version of a strong-typed dataset in the designer, I seem unable to even see the Version attribute in the XML when I use the GetXMLSchema method of that dataset? Any idea or know what my problem may be? Thanks

A: Could you offer any more info as to what you're trying to accomplish. GetXMLSchema doesn't provide any row version info.

Host: Dave Sc (Microsoft)
Q: Also, I’m getting concurrency exceptions when optimistic on for a certain table and adaptor, but not when optimistic off;i'm only user, it's a testDB; somehow during fill some DS fields (original) are altered so optimistic thinks they're not the originals. i think the "messed up" ones are date/time fields...how is this

A: The concurrency checks ensure that you don't accidentally overwrite another user's changes. If there are server-generated columns (auto-increment, timestamp, rowversion) in your concurrency checks, you'll need to fetch those values from the server in order to have subsequent update attempts succeed.

Host: Steve (Microsoft)
Q: No, it can't access it at all...the connection/adaptor/command object are in the web service itself; when webmethod calls .Open() method, first time/every time, it gives me that error; don't think it's locking issue,can access it from other mean

A: Can you get more info from the exception? Hard to say without more info,

Host: Dave Sc (Microsoft)
Q: If you have a DataRowView that is passed to you how can you find out if a certain column in that DataRowView is read-only or not?

A: You can use the Row property on the DataRowView to access the DataRow, then use the DataRow's Table property to access the DataTable. From there, you can access the DataTable's Columns property to locate your DataColumn and check its Read-Only property. I believe that with one or two more properties, you can connect your DataRowView to Kevin Bacon.

Host: Steve (Microsoft)
Q: I am looking for a way to label a Dataset version, or any other ways to read a DataSet's version ?

A: Check out the topic on Getting Specific Versions of a Row: https://msdn.microsoft.com/library/en-us/vbcon/html/vbtskgettingspecificversionsofrow.asp?

Host: Dave Sc (Microsoft)
Q: I hear ObjectSpaces is dead? Did it go anywhere or is it just fading a way?

A: ObjectSpaces is not dead, it's just still under development.

Host: Steve (Microsoft)
Q: System.Data.OleDb.OleDbException: The Microsoft Jet database engine cannot open the file '\\1jssrv\server\NePAD\TestData\NePAD_data.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

A: Make sure the ASPNET user has read/write permissions on the directory as well as the .mdb file. The ASPNET user must be able to create the .ldb file.

Moderator: Ed H (Microsoft)
This has been a GREAT chat. Thank you to everyone. Unfortunately, it is time to go. Thanks for participating, and we'll see you next time!

Top of PageTop of Page