| Bug #39284 | Table adapters define constructor not allowing me to | ||
|---|---|---|---|
| Submitted: | 5 Sep 2008 23:35 | Modified: | 13 Sep 2008 0:11 |
| Reporter: | Chris Robison | ||
| Status: | Verified | ||
| Category: | Connector/Net | Severity: | S4 (Feature request) |
| Version: | 5.2.3 | OS: | Microsoft Windows (Vista Enterprise x86) |
| Assigned to: | Target Version: | ||
| Tags: | table adapters, data sets | ||
| Triage: | D3 (Medium) | ||
[5 Sep 2008 23:35]
Chris Robison
[5 Sep 2008 23:38]
Chris Robison
Default Constructor error
Attachment: DefaultConstructor.jpg (image/jpeg, text), 45.44 KiB.
[8 Sep 2008 10:23]
Tonci Grgin
Hi Chris and thanks for your reasonable feature request. I'll have to leave it in "Open" state until I check following: o) I think this was done on purpose o) The problem, afair, is already reported.
[8 Sep 2008 10:34]
Tonci Grgin
Hi Chris. I was unable to find answers to both of my questions posted above so I'll have to see what Reggie has to say on this. Verified as described.
[12 Sep 2008 18:42]
Reggie Burnett
Chris Are you trying this with VS 2008? If so, are you using SP1? We have already seen some issues actually be bugs in VS. I just tried to reproduce this with VS 2008 SP1. I created a winforms app (couldn't get code generation to work with web app) and created a dataset. Then dropped a Sql server table on the surface. it created a default ctor for the table adapter in the designer file. I then tried it with what will be 5.2.4 and it behaved identically. I don't think this is a bug but I'll wait to hear back from you.
[12 Sep 2008 19:12]
Chris Robison
Yes, I am using VS 2008 sp1. Yes, there is a default constructor created in the designer
file, and that is the problem. In the actual designer interface where you drag stuff and
create the table adapters, you can double click on the table adapter name (or the icon
next to it) and Visual Studio will generate something like:
namespace LSCMCoreDLL.DataSets
{
public partial class CoreDataSet
{
}
}
namespace LSCMCoreDLL.DataSets.CoreDataSetTableAdapters
{
public partial class DomainsTableAdapter
{
}
}
The new file is called <DataSet Name here>.cs. So now in the file system there are two cs
files. <DataSet name>.cs and <DataSet name>.Designer.cs.
If there is already a default ctor in the *.Designer.cs file then you can't define one
here. Which, is the problem, because I think you should be able to define it here,
because the designer file is generated code and the other file will stay the same.
[12 Sep 2008 21:25]
Reggie Burnett
Yes, I agree with you but on my system SqlClient does exactly the same thing.
[13 Sep 2008 0:11]
Chris Robison
You're right, SqlClient does have the same behavior. I could have sworn the last time I checked it out, I could do something like that. Oh well. I guess that is a visual studio thing. Thanks for trying. Chris
