Showing posts with label property. Show all posts
Showing posts with label property. Show all posts

Thursday, March 29, 2012

DataTransfer Error

I have written following lines of code, but when TransferData() method is called, it generates error "Property LoginSecure cannot be changed or read after a connection string has been set."

Can anybody help me? Thanks in advance....

Code:

//1. Create Transfer Object

Transfer transObj = new Transfer();

//transObj=new Transfer(server.Databases[fromdatabasename]);

transObj.DestinationLoginSecure = false;

transObj.DestinationLogin = "sa";

transObj.DestinationPassword = "test";

//Set Destination Server

//Build a "serverConnection" with the information of the "sqlConnection"

destSrvCon =

new ServerConnection(sqlCon);

//The serverConnection is used in the ctor of the Server.

destServer = new Server(destSrvCon);

transObj.DestinationServer = destServer.Name.ToString();

//2. Define Transfer Object's Properties

transObj.Database = server.Databases["Aworks"];

transObj.DestinationDatabase = "AWorksCopy";

transObj.Options.WithDependencies =true;

transObj.Options.ContinueScriptingOnError = true;

transObj.CopySchema = true;

transObj.CopyData = true;

transObj.CopyAllTables = true;

//4. Finally Transfer Data

transObj.TransferData();

//transObj.ScriptTransfer();

I got this error as well, and have tried everything to avoid it. The only explanation I have left is that I'm using server 2000. Is this what you're using Ritesh?
|||I got this error as well. I changed the file permissions on the ReplData folder and it went away.|||

i get this same error.

did you guys resolve the problem?

ReplData folder? only folder i can think of is the folder where the database files are stored....

DataTransfer Error

I have written following lines of code, but when TransferData() method is called, it generates error "Property LoginSecure cannot be changed or read after a connection string has been set."

Can anybody help me? Thanks in advance....

Code:

//1. Create Transfer Object

Transfer transObj = new Transfer();

//transObj=new Transfer(server.Databases[fromdatabasename]);

transObj.DestinationLoginSecure = false;

transObj.DestinationLogin = "sa";

transObj.DestinationPassword = "test";

//Set Destination Server

//Build a "serverConnection" with the information of the "sqlConnection"

destSrvCon =

new ServerConnection(sqlCon);

//The serverConnection is used in the ctor of the Server.

destServer = new Server(destSrvCon);

transObj.DestinationServer = destServer.Name.ToString();

//2. Define Transfer Object's Properties

transObj.Database = server.Databases["Aworks"];

transObj.DestinationDatabase = "AWorksCopy";

transObj.Options.WithDependencies =true;

transObj.Options.ContinueScriptingOnError = true;

transObj.CopySchema = true;

transObj.CopyData = true;

transObj.CopyAllTables = true;

//4. Finally Transfer Data

transObj.TransferData();

//transObj.ScriptTransfer();

I got this error as well, and have tried everything to avoid it. The only explanation I have left is that I'm using server 2000. Is this what you're using Ritesh?
|||I got this error as well. I changed the file permissions on the ReplData folder and it went away.|||

i get this same error.

did you guys resolve the problem?

ReplData folder? only folder i can think of is the folder where the database files are stored....

DataTransfer Error

I have written following lines of code, but when TransferData() method is called, it generates error "Property LoginSecure cannot be changed or read after a connection string has been set."

Can anybody help me? Thanks in advance....

Code:

//1. Create Transfer Object

Transfer transObj = new Transfer();

//transObj=new Transfer(server.Databases[fromdatabasename]);

transObj.DestinationLoginSecure = false;

transObj.DestinationLogin = "sa";

transObj.DestinationPassword = "test";

//Set Destination Server

//Build a "serverConnection" with the information of the "sqlConnection"

destSrvCon =

new ServerConnection(sqlCon);

//The serverConnection is used in the ctor of the Server.

destServer = new Server(destSrvCon);

transObj.DestinationServer = destServer.Name.ToString();

//2. Define Transfer Object's Properties

transObj.Database = server.Databases["Aworks"];

transObj.DestinationDatabase = "AWorksCopy";

transObj.Options.WithDependencies =true;

transObj.Options.ContinueScriptingOnError = true;

transObj.CopySchema = true;

transObj.CopyData = true;

transObj.CopyAllTables = true;

//4. Finally Transfer Data

transObj.TransferData();

//transObj.ScriptTransfer();

I got this error as well, and have tried everything to avoid it. The only explanation I have left is that I'm using server 2000. Is this what you're using Ritesh?
|||I got this error as well. I changed the file permissions on the ReplData folder and it went away.|||

i get this same error.

did you guys resolve the problem?

ReplData folder? only folder i can think of is the folder where the database files are stored....

DataTransfer Error

I have written following lines of code, but when TransferData() method is called, it generates error "Property LoginSecure cannot be changed or read after a connection string has been set."

Can anybody help me? Thanks in advance....

Code:

//1. Create Transfer Object

Transfer transObj = new Transfer();

//transObj=new Transfer(server.Databases[fromdatabasename]);

transObj.DestinationLoginSecure = false;

transObj.DestinationLogin = "sa";

transObj.DestinationPassword = "test";

//Set Destination Server

//Build a "serverConnection" with the information of the "sqlConnection"

destSrvCon =

new ServerConnection(sqlCon);

//The serverConnection is used in the ctor of the Server.

destServer = new Server(destSrvCon);

transObj.DestinationServer = destServer.Name.ToString();

//2. Define Transfer Object's Properties

transObj.Database = server.Databases["Aworks"];

transObj.DestinationDatabase = "AWorksCopy";

transObj.Options.WithDependencies =true;

transObj.Options.ContinueScriptingOnError = true;

transObj.CopySchema = true;

transObj.CopyData = true;

transObj.CopyAllTables = true;

//4. Finally Transfer Data

transObj.TransferData();

//transObj.ScriptTransfer();

I got this error as well, and have tried everything to avoid it. The only explanation I have left is that I'm using server 2000. Is this what you're using Ritesh?
|||I got this error as well. I changed the file permissions on the ReplData folder and it went away.|||

i get this same error.

did you guys resolve the problem?

ReplData folder? only folder i can think of is the folder where the database files are stored....

Sunday, March 25, 2012

Datasource

I have several hundred reports that I need to change the Datasource to point
to another server. Without going one report property at a time and changing
the datasource, is there a way to run an update statement on ReportServer
database to use the new target server for the said reports? If running an
update is not advisable then how do I make global change to the reports data
sources?
Thanks in advance for the assistance.
--
Lito DWhy don't you just change the connection string of the current Data Source
instead of creating a new one and changing all of the reports?
--
Chris Alton, Microsoft Corp.
SQL Server Developer Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
> Thread-Topic: Datasource
> thread-index: AcgQYLyNYww3Wxw0QxS8ZfpBNLID8A==> X-WBNR-Posting-Host: 207.46.19.168
> From: =?Utf-8?B?TElUTw==?= <anynomous@.msn.com>
> Subject: Datasource
> Date: Tue, 16 Oct 2007 18:55:04 -0700
> I have several hundred reports that I need to change the Datasource to
point
> to another server. Without going one report property at a time and
changing
> the datasource, is there a way to run an update statement on ReportServer
> database to use the new target server for the said reports? If running an
> update is not advisable then how do I make global change to the reports
data
> sources?
> Thanks in advance for the assistance.
> --
> Lito D
>|||The problem is that some reports must stay on the live server whereas the
rest should go to another server having previous day old data. I assume
there is a utility ( not too familiar with rs.exec) that I can issue via
command line to change the datasource from one to another then manually
change the few reports that must stay on the live server.
Lito D
"Chris Alton [MSFT]" wrote:
> Why don't you just change the connection string of the current Data Source
> instead of creating a new one and changing all of the reports?
> --
> Chris Alton, Microsoft Corp.
> SQL Server Developer Support Engineer
> This posting is provided "AS IS" with no warranties, and confers no rights.
> --
> > Thread-Topic: Datasource
> > thread-index: AcgQYLyNYww3Wxw0QxS8ZfpBNLID8A==> > X-WBNR-Posting-Host: 207.46.19.168
> > From: =?Utf-8?B?TElUTw==?= <anynomous@.msn.com>
> > Subject: Datasource
> > Date: Tue, 16 Oct 2007 18:55:04 -0700
> >
> > I have several hundred reports that I need to change the Datasource to
> point
> > to another server. Without going one report property at a time and
> changing
> > the datasource, is there a way to run an update statement on ReportServer
> > database to use the new target server for the said reports? If running an
> > update is not advisable then how do I make global change to the reports
> data
> > sources?
> >
> > Thanks in advance for the assistance.
> >
> > --
> > Lito D
> >
>|||If you are using a Shared DataSource for your reports then you are going to
have to create a new Data Source anyway. So if all you have are a few
reports to change that stay on the live server then just change the
existing Shared Data Source to point to the new server and then create a
second Data Source that points to the old server. Then manually change the
few reports to the new Shared Data Source. If you are using embedded Data
Sources in your reports then you've got a tedious job ahead of you. The
following tool might help you out but its a 3rd party tool and I haven't
really used it extensively.
http://www.sqldbatips.com/showarticle.asp?ID=62
--
Chris Alton, Microsoft Corp.
SQL Server Developer Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
> Thread-Topic: Datasource
> thread-index: AcgRFlfiLyP20tutQlCHtUWElaYfEw==> X-WBNR-Posting-Host: 207.46.19.197
> From: =?Utf-8?B?TElUTw==?= <anynomous@.msn.com>
> References: <A60B2818-F70D-4150-BBA9-41BEC7FCDC93@.microsoft.com>
<4c7dqiMEIHA.360@.TK2MSFTNGHUB02.phx.gbl>
> Subject: RE: Datasource
> Date: Wed, 17 Oct 2007 16:35:04 -0700
> The problem is that some reports must stay on the live server whereas the
> rest should go to another server having previous day old data. I assume
> there is a utility ( not too familiar with rs.exec) that I can issue via
> command line to change the datasource from one to another then manually
> change the few reports that must stay on the live server.
>
> --
> Lito D
>
> "Chris Alton [MSFT]" wrote:
> > Why don't you just change the connection string of the current Data
Source
> > instead of creating a new one and changing all of the reports?
> >
> > --
> > Chris Alton, Microsoft Corp.
> > SQL Server Developer Support Engineer
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> > --
> > > Thread-Topic: Datasource
> > > thread-index: AcgQYLyNYww3Wxw0QxS8ZfpBNLID8A==> > > X-WBNR-Posting-Host: 207.46.19.168
> > > From: =?Utf-8?B?TElUTw==?= <anynomous@.msn.com>
> > > Subject: Datasource
> > > Date: Tue, 16 Oct 2007 18:55:04 -0700
> > >
> > > I have several hundred reports that I need to change the Datasource
to
> > point
> > > to another server. Without going one report property at a time and
> > changing
> > > the datasource, is there a way to run an update statement on
ReportServer
> > > database to use the new target server for the said reports? If
running an
> > > update is not advisable then how do I make global change to the
reports
> > data
> > > sources?
> > >
> > > Thanks in advance for the assistance.
> > >
> > > --
> > > Lito D
> > >
> >
> >
>sql

Monday, March 19, 2012

Datareader source/Data flow task property expression problems

Hi all,
I have the June CTP version of Yukon and it's various tools, and I'm having an issue with using property expressions or variable syntax within the SqlCommand string of a datareader source within a data flow task. It seems as if there were issues in past versions of doing this within data flow tasks, but I thought with the June CTP that this was a possibility. The documentation even states that you can do this within the sqlcommand property. Anybody else have this problem? Any solutions?
Thanks,
Adrian CrawfordHello Adrian,
Not sure exactly what you mean by "I'm having an issue with using property expressions or variable syntax" Are you referring to it error-ing out, or are the values not showing up properly?

Maybe the workaround in this post might help you?
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=70082

Jason|||Hey Jason,
Thanks for the reply. It is erroring out and not accepting my sqlcommand when I try to use any dts variables in the query. The datareader source works a little differently in that it doesn't give you the option to parse/build your query like other tasks do. Unfortunately there is not much of an error message to give. I get...
Further changes need to be made before the current settings can be saved to the component. Warnings reported by the component are:
And then nothing is listed. I'm trying to query an Oracle db and use dts vars in the query, but i have a feeling they are not getting parsed before being sent to Oracle.
Adrian
|||Hi Adrian,
Can you share your expression? I'd like to try to reproduce this so I can see why the error message is incorrect.
Also, what is the scope of the variables you are using?

Thanks
Mark|||Mark,
Thanks for your response. I figured out my problem in another recent post here:
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=73466
Basically I found that you can't directly enter variables or expressions in the sqlcommand box, since it will not parse it before being sent. I found the round about way in the above post.
Thanks,
Adrian

Wednesday, March 7, 2012

DataDir Property - Is it possible to store files on more than 1 drive?

The "DataDir" property for an AS 2005 instance seems to only allow for one path to be specified. I am working with a very large data set that is being updated frequently and I would like to be able to reference more than on LUN on my disk array.

Yes, you can.

Take a look at the StorageLocation property of your partition.

Edward Melomed (MSFT)

--

This posting is provided "AS IS" with no warranties, and confers no rights.

DataBinding: System.Data.DataRowView does not contain a property with the name RMID.

I m trying to UPDATE database using FormView and SqlDataSource and here is my code:

<

asp:SqlDataSourceID="sqlDS1"runat="server"ConnectionString="<%$ ConnectionStrings:myDB %>"UpdateCommand="UPDATE [Consultants] SET [firstName]=@.FIRSTNAME,[lastName]=@.LASTNAME,[skillCategoryID]=@.SKILLCATID,[resourceManagerID]=@.RMID,[AMgroupID]=@.AMGROUPID,[SkillSet]=@.SKILLSET,[statusID]=@.STATUSID,[location]=@.LOCATION,[comments]=@.COMMENTS,[profile]=@.PROFILE,[isAvailable]=@.ISAVAILABLE,[dateModified]=getdate(),[focusID]=1 WHERE ([id]=@.ID)">

<

UpdateParameters><asp:FormParameterFormField="txtFName"Name="FIRSTNAME"/><asp:FormParameterFormField="txtLName"Name="LASTNAME"/><asp:FormParameterFormField="ddlSkillCat"Name="SKILLCATID"/><asp:FormParameterFormField="ddlRM"Name="RMID"/><asp:FormParameterFormField="ddlAMGroup"Name="AMGROUPID"/><asp:FormParameterFormField="txtSkillset"Name="SKILLSET"/><asp:FormParameterFormField="ddlStatus"Name="STATUSID"Type="Int16"/><asp:FormParameterFormField="txtLocation"Name="LOCATION"/><asp:FormParameterFormField="txtComments"Name="COMMENTS"/><asp:FormParameterFormField="txtProfile"Name="PROFILE"/><asp:FormParameterFormField="cbAvailable"Name="ISAVAILABLE"/><asp:QueryStringParameterType="Int32"Name="ID"QueryStringField="id"/></UpdateParameters></asp:SqlDataSource>

//*******************************************************************

<

asp:FormViewDefaultMode="Edit"ID="FormView1"runat="server"DataSourceID="sqlDS1"DataKeyNames="id"><EditItemTemplate>

<

tr><tdclass="blacktextbold">

Resource Manager:

</td><tdclass="blacktext"><asp:DropDownListID="ddlRM"CssClass="blacktext"runat="server"DataSource="<%#GetRM()%>"DataTextField="RMName"DataValueField="userID"SelectedValue="<%#Bind('RMID')%>"AppendDataBoundItems="true"><asp:ListItemValue="-1">--Select RM--</asp:ListItem></asp:DropDownList><asp:CustomValidatorID="cvRM"runat="server"ValidationGroup="gpInsert"ControlToValidate="ddlRM"ClientValidationFunction="validateDropdown"OnServerValidate="servervalidateDropdown"Display="Dynamic"ErrorMessage="Required Field"CssClass="redtextsmallbold"/></td></tr>

//********************************************************

here is my GetRM() function:

protected

DataSet GetRM()

{

string strConnection =ConfigurationManager.ConnectionStrings["myDB"].ToString();SqlConnection objConnection =newSqlConnection(strConnection);String sqlSkillCats ="SELECT Roles.roleID, Roles.roleName, UsersInRoles.userID, UsersInRoles.roleID AS Expr1, Users.firstName + ' ' + Users.lastName AS RMName, Users.id AS Expr2" +" FROM Users INNER JOIN" +" UsersInRoles ON Users.id = UsersInRoles.userID CROSS JOIN" +" Roles" +" WHERE (Roles.roleName = 'accountmanager') AND (UsersInRoles.roleID = Roles.roleID) ORDER BY Users.firstName";SqlDataAdapter objAdapter =newSqlDataAdapter(sqlSkillCats, objConnection);

objConnection.Open();

//ddlDataSet = new DataSet();try

{

objAdapter.Fill(dsConsultantRM,

"ConsultantRM");

}

catch (Exception ex)

{

Response.Write(ex.Message);

}

objConnection.Close();

return dsConsultantRM;

}

//******************************************************************

i get this error when i load the page:
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'RMID'.

basically i m trying to UPDATE database using the value selected in the DropDownList, can anyone tell me whats wrong here...PLZ HELP!

I don't see a SelectCommand on your sqldatasource.|||

select command was in the function which returned the dataset. But that wasnt the issue, after changing all the CAPS parameter names to the exact name of the columns in my database i dint get any error!!!! i wonder why, for example i changed this:

<asp:parameter formfield="ddlRM" name="RMID"/>
TO
<asp:parameter formfield="ddlRM" name="resourceManagerID"/>

and then SelectedValue="<%#Bind('resourceManagerID')%>

Sunday, February 26, 2012

DataBinding: System.Data.DataRowView does not contain a property with the name Component_P

Hi,

Seems like a lot of people are having a similiar problem that I am having right now, but I am not able to find the solution to it. On the Page_load event, the gridview does display the data from database. When I click a button to insert the same data but different Waste_Profile_Num value, it gives me the databinding error. Component_Profile_ID is declared as an Identity and it is the primary key to the table. Anyway help?

Ok, the following are code that I have:

1 <asp:SqlDataSource ID="sqlDSMaterialComposition" runat="server" ConnectionString="<%$ ConnectionStrings:HAZConnectionString %>"2 SelectCommand="SELECT dbo.Component_Profile.Component_Profile_ID AS Component_Profile_ID, dbo.Component.Component, dbo.Component_Profile.Concentration, dbo.Component_Profile.Range, dbo.Component_Profile.Waste_Profile_Num, dbo.Component.Component_ID FROM dbo.Component INNER JOIN dbo.Component_Profile ON dbo.Component.Component_ID = dbo.Component_Profile.Component_ID WHERE (dbo.Component_Profile.Waste_Profile_Num = @.Waste_Profile_Num)">3 <SelectParameters>4 <asp:SessionParameter Name="Waste_Profile_Num" SessionField="Waste_Profile_Num" Type="Int32" />5 </SelectParameters>6 </asp:SqlDataSource>789 <asp:GridView ID="GridViewMaterialComposition"10 runat="server"11 DataKeyNames="Component_Profile_ID,Component_ID"12 AutoGenerateColumns="False" ShowFooter="true">13 <Columns>14 <asp:BoundField DataField="Component" HeaderText="Component" SortExpression="Component" FooterText="Total"/>15 <asp:TemplateField HeaderText="Concentration" FooterStyle-Font-Bold="true">16 <ItemTemplate>17 <%# SumConcentration(decimal.Parse(Eval("Concentration").ToString())).tostring("N2") %>18 </ItemTemplate>19 <FooterTemplate>20 <%# GetConcentration().tostring("N2") %>21 </FooterTemplate>22 </asp:TemplateField>23 <asp:BoundField DataField="Range" HeaderText="Range" SortExpression="Range" />24 <asp:BoundField DataField="Component_Profile_ID" HeaderText="Component_Profile_ID" ReadOnly="True" SortExpression="Component_Profile_ID" Visible="true" />25 <asp:BoundField DataField="Component_ID" HeaderText="Component_ID" ReadOnly="True" SortExpression="Component_ID" Visible="true"/>26 <asp:BoundField DataField="Waste_Profile_Num" HeaderText="Waste_Profile_Num" ReadOnly="true" SortExpression="Waste_Profile_Num" Visible="true" />27 <asp:CommandField ShowEditButton="true" />28 <asp:TemplateField Visible="false">29 <ItemTemplate>30 <asp:Label ID="lblComponentProfileID" runat="Server" Text='<% # Eval("Component_Profile_ID") %>'></asp:Label>31 <asp:Label ID="lblComponentID" runat="Server" Text='<% # Eval("Component_ID") %>'></asp:Label>32 </ItemTemplate>33 </asp:TemplateField>34 </Columns>35 </asp:GridView>
The following are the code-behind:
 
1 sqlSelect ="SELECT Range, Concentration, Component_ID FROM Component_Profile WHERE (Component_Profile.Waste_Profile_Num = " & previousWasteProfileNum &")"2 sqlDSMaterialComposition.SelectCommand = sqlSelect3Try4 Dim dvCompositionAs Data.DataView =CType(sqlDSMaterialComposition.Select(DataSourceSelectArguments.Empty), Data.DataView)5For Each drAs Data.DataRowIn dvComposition.Table.Rows6 insertSql ="INSERT INTO Component_Profile ([Range], [Concentration], [Component_ID], [Waste_Profile_Num]) "7 insertSql &="VALUES (" & dr("Range").ToString.Trim &", " & dr("Concentration").ToString.Trim &", " & dr("Component_ID").ToString.Trim &", " &CInt(Session("Waste_Profile_Num").ToString()) &")"8 sqlDSMaterialComposition.InsertCommand = insertSql9 sqlDSMaterialComposition.Insert()10Next11 Catch exAs Exception1213End Try

Hi guys,

that's ok. I have figured that out. I just need to databind the gridview after the for each statement

DataBinding: System.Data.DataRowView does not contain a property with the name

Here's a new one I came across that stumped me for a bit.

DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'xxxx'.

It appears that one of my dropdown menus was referencing the old SqlDataSource1for its data source id.

I had already changed the name of the of the id to something else though.

To fix it, I just updated the reference to the new name.

Thought I'd share, just in case

Hi eterry,

Is this issue already resolved?

|||Yes it is. Sorry about that.

Friday, February 24, 2012

DATABASEPROPERTYEX linked server

It is possible to grap a database property from a database on a linked server? Like this?
Select DATABASEPROPERTYEX('servername.databasename','Reco very')
Thanks!
TommyI Tried a variety of ways, and it doesn't look like it...

Select DATABASEPROPERTYEX('QA.dbo.Northwind','Recovery')|||Same results, here, I just get null. I'm going to try to look at the sysdatabases.status field. I just need to get the recovery model, and see if the database is online or not.

Thanks

Tommy|||Why not create a sproc on each (master) db and do a remotr sproc call? That should work...|||..know what?

If you could do that then you would easily have the ability to know...they shouldn't change strategies at all...

If you're the dba you should know...

You should have an inventory of everything...are these out of your control, and what are you trying to accomplish? (inventory automation?)|||Brett:

Thanks for your help. I'm an ISP, and my users have the ability to set their db's the simple. I run my own log shipping scripts. When I backup the logs on the source, it's easy to check the status, and NOT back up logs if it's set to simple. The restorelog runs on the failover server, and I have to tell my script to not try to restore if the original db is set to simple. Other wise, my job shows as failed, even it it fails on one database that is set to simple.

Tommy|||Are these physical servers or instances of sql 2k?

In either case you have to build both, just store a sproc in master, and open a cursor to find the dbs with

select * from sysdatabases