Just in case anyone else has any doubts, here's the generated xsd file
(slightly anonymised):
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="ItregMailDe tailsTypedDataS et"
targetNamespace ="http://tempuri.org/ItregMailDetail sTypedDataSet.x sd"
xmlns:mstns="ht tp://tempuri.org/ItregMailDetail sTypedDataSet.x sd"
xmlns="http://tempuri.org/ItregMailDetail sTypedDataSet.x sd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata"
xmlns:msprop="u rn:schemas-microsoft-com:xml-msprop"
attributeFormDe fault="qualifie d" elementFormDefa ult="qualified" >
<xs:annotatio n>
<xs:appinfo source="urn:sch emas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnecti onIndex="0"
FunctionsCompon entName="Querie sTableAdapter" Modifier="AutoL ayout,
AnsiClass, Class, Public" SchemaSerializa tionMode="Inclu deSchema"
xmlns="urn:sche mas-microsoft-com:xml-msdatasource">
<Connections>
<Connection AppSettingsObje ctName="Setting s"
AppSettingsProp ertyName="aserv ernamedevConnec tionString"
ConnectionStrin gObject="" IsAppSettingsPr operty="True" Modifier="Assem bly"
Name="aserverna medevConnection String (Settings)" ParameterPrefix ="@"
PropertyReferen ce="Application Settings.ItregM ailDetailsTyped DataSet.Propert ies.Settings.Gl obalReference.D efault.aservern amedevConnectio nString"
Provider="Syste m.Data.SqlClien t">
</Connection>
</Connections>
<Tables>
<TableAdapter BaseClass="Syst em.ComponentMod el.Component"
DataAccessorMod ifier="AutoLayo ut, AnsiClass, Class, Public"
DataAccessorNam e="atablenameTa bleAdapter"
GeneratorDataCo mponentClassNam e="atablenameTa bleAdapter" Name="atablenam e"
UserDataCompone ntName="atablen ameTableAdapter ">
<MainSource>
<DbSource ConnectionRef=" aservernamedevC onnectionString
(Settings)" DbObjectName="a servernamedev.d bo.atablename"
DbObjectType="T able" FillMethodModif ier="Public" FillMethodName= "Fill"
GenerateMethods ="Both" GenerateShortCo mmands="True"
GeneratorGetMet hodName="GetDat a" GeneratorSource Name="Fill"
GetMethodModifi er="Public" GetMethodName=" GetData" QueryType="Rows et"
ScalarCallRetva l="System.Objec t, mscorlib, Version=2.0.0.0 , Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9" UseOptimisticCo ncurrency="True "
UserGetMethodNa me="GetData" UserSourceName= "Fill">
<DeleteComman d>
<DbCommand CommandType="Te xt" ModifiedByUser= "False">
<CommandText>DE LETE FROM [dbo].[atablename] WHERE
(([mailbox] = @Original_mailb ox) AND ([storage_group] =
@Original_stora ge_group) AND ([server] = @Original_serve r))</CommandText>
<Parameters>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @Original_mailb ox" Precision="0" ProviderType="V arChar"
Scale="0" Size="0" SourceColumn="m ailbox" SourceColumnNul lMapping="False "
SourceVersion=" Original">
</Parameter>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @Original_stora ge_group" Precision="0" ProviderType="V arChar"
Scale="0" Size="0" SourceColumn="s torage_group"
SourceColumnNul lMapping="False " SourceVersion=" Original">
</Parameter>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @Original_serve r" Precision="0" ProviderType="V arChar"
Scale="0" Size="0" SourceColumn="s erver" SourceColumnNul lMapping="False "
SourceVersion=" Original">
</Parameter>
</Parameters>
</DbCommand>
</DeleteCommand>
<InsertComman d>
<DbCommand CommandType="Te xt" ModifiedByUser= "False">
<CommandText>IN SERT INTO [dbo].[atablename] ([mailbox],
[storage_group], [server]) VALUES (@mailbox, @storage_group, @server);
SELECT mailbox, storage_group, server FROM atablename WHERE (mailbox =
@mailbox)</CommandText>
<Parameters>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @mailbox" Precision="0" ProviderType="V arChar" Scale="0"
Size="0" SourceColumn="m ailbox" SourceColumnNul lMapping="False "
SourceVersion=" Current">
</Parameter>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @storage_group" Precision="0" ProviderType="V arChar"
Scale="0" Size="0" SourceColumn="s torage_group"
SourceColumnNul lMapping="False " SourceVersion=" Current">
</Parameter>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @server" Precision="0" ProviderType="V arChar" Scale="0"
Size="0" SourceColumn="s erver" SourceColumnNul lMapping="False "
SourceVersion=" Current">
</Parameter>
</Parameters>
</DbCommand>
</InsertCommand>
<SelectComman d>
<DbCommand CommandType="Te xt" ModifiedByUser= "False">
<CommandText>SE LECT mailbox, storage_group, server FROM
dbo.atablename</CommandText>
<Parameters>
</Parameters>
</DbCommand>
</SelectCommand>
<UpdateComman d>
<DbCommand CommandType="Te xt" ModifiedByUser= "False">
<CommandText>UP DATE [dbo].[atablename] SET [mailbox] =
@mailbox, [storage_group] = @storage_group, [server] = @server WHERE
(([mailbox] = @Original_mailb ox) AND ([storage_group] =
@Original_stora ge_group) AND ([server] = @Original_serve r));
SELECT mailbox, storage_group, server FROM atablename WHERE (mailbox =
@mailbox)</CommandText>
<Parameters>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @mailbox" Precision="0" ProviderType="V arChar" Scale="0"
Size="0" SourceColumn="m ailbox" SourceColumnNul lMapping="False "
SourceVersion=" Current">
</Parameter>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @storage_group" Precision="0" ProviderType="V arChar"
Scale="0" Size="0" SourceColumn="s torage_group"
SourceColumnNul lMapping="False " SourceVersion=" Current">
</Parameter>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @server" Precision="0" ProviderType="V arChar" Scale="0"
Size="0" SourceColumn="s erver" SourceColumnNul lMapping="False "
SourceVersion=" Current">
</Parameter>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @Original_mailb ox" Precision="0" ProviderType="V arChar"
Scale="0" Size="0" SourceColumn="m ailbox" SourceColumnNul lMapping="False "
SourceVersion=" Original">
</Parameter>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @Original_stora ge_group" Precision="0" ProviderType="V arChar"
Scale="0" Size="0" SourceColumn="s torage_group"
SourceColumnNul lMapping="False " SourceVersion=" Original">
</Parameter>
<Parameter AllowDbNull="Fa lse" AutogeneratedNa me=""
DataSourceName= "" DbType="AnsiStr ing" Direction="Inpu t"
ParameterName=" @Original_serve r" Precision="0" ProviderType="V arChar"
Scale="0" Size="0" SourceColumn="s erver" SourceColumnNul lMapping="False "
SourceVersion=" Original">
</Parameter>
</Parameters>
</DbCommand>
</UpdateCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="m ailbox" DataSetColumn=" mailbox" />
<Mapping SourceColumn="s torage_group"
DataSetColumn=" storage_group" />
<Mapping SourceColumn="s erver" DataSetColumn=" server" />
</Mappings>
<Sources>
<DbSource ConnectionRef=" aservernamedevC onnectionString
(Settings)" DbObjectName="a servernamedev.d bo.usp_itreg_ro undrobin"
DbObjectType="S toredProcedure" FillMethodModif ier="Public"
FillMethodName= "FillBy" GenerateMethods ="Both" GenerateShortCo mmands="True"
GeneratorGetMet hodName="GetDat aBy" GeneratorSource Name="FillBy"
GetMethodModifi er="Public" GetMethodName=" GetDataBy" QueryType="Rows et"
ScalarCallRetva l="System.Objec t, mscorlib, Version=2.0.0.0 , Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9" UseOptimisticCo ncurrency="True "
UserGetMethodNa me="GetDataBy" UserSourceName= "FillBy">
<SelectComman d>
<DbCommand CommandType="St oredProcedure"
ModifiedByUser= "False">
<CommandText>db o.usp_itreg_rou ndrobin</CommandText>
<Parameters>
<Parameter AllowDbNull="Tr ue" AutogeneratedNa me=""
DataSourceName= "" DbType="Int32" Direction="Retu rnValue"
ParameterName=" @RETURN_VALUE" Precision="10" ProviderType="I nt" Scale="0"
Size="4" SourceColumnNul lMapping="False " SourceVersion=" Current">
</Parameter>
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
</Sources>
</TableAdapter>
</Tables>
<Sources>
</Sources>
</DataSource>
</xs:appinfo>
</xs:annotation>
<xs:element name="ItregMail DetailsTypedDat aSet" msdata:IsDataSe t="true"
msdata:UseCurre ntLocale="true"
msprop:Generato r_UserDSName="I tregMailDetails TypedDataSet"
msprop:Generato r_DataSetName=" ItregMailDetail sTypedDataSet">
<xs:complexType >
<xs:choice minOccurs="0" maxOccurs="unbo unded">
<xs:element name="atablenam e"
msprop:Generato r_UserTableName ="atablename "
msprop:Generato r_RowDeletedNam e="atablenameRo wDeleted"
msprop:Generato r_RowChangedNam e="atablenameRo wChanged"
msprop:Generato r_RowClassName= "atablename Row"
msprop:Generato r_RowChangingNa me="atablenameR owChanging"
msprop:Generato r_RowEvArgName= "atablenameRowC hangeEvent"
msprop:Generato r_RowEvHandlerN ame="atablename RowChangeEventH andler"
msprop:Generato r_TableClassNam e="atablenameDa taTable"
msprop:Generato r_TableVarName= "tableatablenam e"
msprop:Generato r_RowDeletingNa me="atablenameR owDeleting"
msprop:Generato r_TablePropName ="atablename ">
<xs:complexType >
<xs:sequence>
<xs:element name="mailbox"
msprop:Generato r_UserColumnNam e="mailbox"
msprop:Generato r_ColumnVarName InTable="column mailbox"
msprop:Generato r_ColumnPropNam eInRow="mailbox "
msprop:Generato r_ColumnPropNam eInTable="mailb oxColumn">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="15" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="storage_g roup"
msprop:Generato r_UserColumnNam e="storage_grou p"
msprop:Generato r_ColumnVarName InTable="column storage_group"
msprop:Generato r_ColumnPropNam eInRow="storage _group"
msprop:Generato r_ColumnPropNam eInTable="stora ge_groupColumn" >
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="server"
msprop:Generato r_UserColumnNam e="server"
msprop:Generato r_ColumnVarName InTable="column server"
msprop:Generato r_ColumnPropNam eInRow="server"
msprop:Generato r_ColumnPropNam eInTable="serve rColumn">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="15" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constrain t1">
<xs:selector xpath=".//mstns:atablenam e" />
<xs:field xpath="mstns:ma ilbox" />
</xs:unique>
</xs:element>
</xs:schema>
"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:eP******** ******@TK2MSFTN GP02.phx.gbl...
Nirosh. That's what we've done. That's why I'm asking the question.
Peter
"Champika Nirosh" <te**@tc.comwro te in message
news:ub******** ******@TK2MSFTN GP02.phx.gbl...
>>I am pretty sure that you are doing some thing wrong here.. can you just
create a seperate type dataset and confirm that it add a connection string
too?? Why it need to have a connection string hradcoded to create a typed
dataset for you.. but it you select the optipon of autocreating the DAL
then yes it does add a hardcoded connection string to the dataset..
Nirosh.
"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:uH******* *******@TK2MSFT NGP02.phx.gbl.. .
>>Thanks Nirosh, but I'm not sure I understood all that.
I'm only talking about a typed DataSet: not about the entire data access
layer - which we code ourselves and which uses many typed datasets. At
least that was the case until now. If typed datasets now have the
connection string hard coded into them, we'll definitely not be using
them any more - for security reasons apart from anything else.
Peter
"Champika Nirosh" <te**@tc.comwro te in message
news:eL****** ********@TK2MSF TNGP04.phx.gbl. ..
VSS 2005 support auto generating the dataaccess layer .. and in that
case you are free to change the code where it hardcode the connection
string so that it will read it from a config file (obviously you have
to change the code again if you have to create/ edit the dataset again.
In my view point the automatically generated code is very good if you
are heading toward a quick concept demo or a working prototype.. but if
you are looking to develop a real extensible large-scale system, then I
rather advice you to have your own data access layer, indeed you may
have some assistance from the Data access Applcation Blocks or
enterprise library. There you will get that chance of developing a
flexible dataaccess layer.. I am telling this with my experience and if
you go with the auto geneated code you will at times drive in to
bottleneck of your code..
Nirosh.
"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:eL***** *********@TK2MS FTNGP02.phx.gbl ...
Hi all,
>
This post is sort of tangentially related to my earlier posts on
configurati on files for DLLs.
>
Does anyone know how to create typed DataSets using VS2005's new
DataSet designer, but with the ability to configure the connection
string via a config file? The designer seems to hard-code the
connectio n string into the dataset itself, which just can't be right.
>
The typed DataSets created by VS2005 comes with a dll.config file that
looks as though it's trying to do something like that, and which is
put with the executable at compile time, but altering the connection
string in there doesn't appear to have any effect. We've seen lots of
people asking this question, but haven't found anyone answering it
yet.
>
>
Thanks in advance
>
>
>
>
>
Peter
>
>