Showing posts with label extension. Show all posts
Showing posts with label extension. Show all posts

Sunday, February 19, 2012

Extracting Parameter values from a Custom Data Processing Extension

I've created a custom Data Processing Extension and I've implemented the IDBCommandAnalysis interface so that my reports can enter parameters and pass them to my Data Processing Extension.

My question is, how do I extract the value from the Parameters coming from the report? Where do the parameters get passed off from the report? I can query the Parameters collection and my report gets prompted in Preview mode to enter something for the parameter but I can't find the spot where it gets passed for processing.

The IDBCommand interface contains a method CreateParameter(...).

For every query parameter, RS will call CreateParameter to add the parameter to the Parameters collection.

See also: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_clr_dataproc_2a4a.asp

-- Robert

|||Where is the proper place to initialize the Parameter collection? I keep getting a "Collection was modified" when I try to tell my Command object was parameters it has.|||

Robert Bruckner MSFT wrote:

For every query parameter, RS will call CreateParameter to add the parameter to the Parameters collection.

Sorry for pullig out this old thread, but it's exactly the problem I have right now.
At the moment my CreateParameter()-Function looks like this (like in the FSI example)

Code Snippet

Return CType(New DataParameter, IDataParameter)


nothing more. As an extra, I am searching for parameters everytime the command-text is set. I am pullig out the parameters from the text with a regExp and add them to the collection.
Is this the right way?

In technet it says: "The CreateParameter method is called by the report server to set the name and value for each query parameter in the command text. The parameter is then added to the Parameters collection prior to the ExecuteReader method being called."

Right now, I am doing all of that in my cde manually:
set command-text? then get parameters from string -> add all of them to the collection.

without this extra-step after setting the command-text, the collection gets called later and would be empty. There is no call from report-server to CreateParameter. (I put traces in every function/sub)|||Ok, I worked it out:

"Public ReadOnly Property Parameters() As IDataParameterCollection Implements IDbCommand.Parameters"
This one is used by the server to access and build up the parameterCollection.

"Public Function GetParameters() As IDataParameterCollection Implements IDbCommandAnalysis.GetParameters"
This one has to parse out all parameters from the query, so the dataset preview can list them.
http://technet.microsoft.com/en-us/library/aa256673(SQL.80).aspx

Extracting Parameter values from a Custom Data Processing Extension

I've created a custom Data Processing Extension and I've implemented the IDBCommandAnalysis interface so that my reports can enter parameters and pass them to my Data Processing Extension.

My question is, how do I extract the value from the Parameters coming from the report? Where do the parameters get passed off from the report? I can query the Parameters collection and my report gets prompted in Preview mode to enter something for the parameter but I can't find the spot where it gets passed for processing.

The IDBCommand interface contains a method CreateParameter(...).

For every query parameter, RS will call CreateParameter to add the parameter to the Parameters collection.

See also: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_clr_dataproc_2a4a.asp

-- Robert

|||Where is the proper place to initialize the Parameter collection? I keep getting a "Collection was modified" when I try to tell my Command object was parameters it has.
|||

Robert Bruckner MSFT wrote:


For every query parameter, RS will call CreateParameter to add the parameter to the Parameters collection.

Sorry for pullig out this old thread, but it's exactly the problem I have right now.
At the moment my CreateParameter()-Function looks like this (like in the FSI example)

Code Snippet

Return CType(New DataParameter, IDataParameter)


nothing more. As an extra, I am searching for parameters everytime the command-text is set. I am pullig out the parameters from the text with a regExp and add them to the collection.
Is this the right way?

In technet it says: "The CreateParameter method is called by the report server to set the name and value for each query parameter in the command text. The parameter is then added to the Parameters collection prior to the ExecuteReader method being called."

Right now, I am doing all of that in my cde manually:
set command-text? then get parameters from string -> add all of them to the collection.

without this extra-step after setting the command-text, the collection gets called later and would be empty. There is no call from report-server to CreateParameter. (I put traces in every function/sub)
|||Ok, I worked it out:

"Public ReadOnly Property Parameters() As IDataParameterCollection Implements IDbCommand.Parameters"
This one is used by the server to access and build up the parameterCollection.

"Public Function GetParameters() As IDataParameterCollection Implements IDbCommandAnalysis.GetParameters"
This one has to parse out all parameters from the query, so the dataset preview can list them.
http://technet.microsoft.com/en-us/library/aa256673(SQL.80).aspx

Friday, February 17, 2012

Extracting Data from SQL CE SDF file

Hi,

I have written application for Pocket PC it stores data on SQL CE database with extension .sdf. I have added data to the table and synchronised to the SQl server. I got the data, then unfortunately i deleted the data in SQL Server, I want to extract the data again from .SDF file of Pocket PC.

Is this possible if not then how can i get the data from SDF to SQL Server

Its very urgent and waiting for early reply to following mail address
prashanthk@.mmi.ae

Regards,
Prashanththere are a couple of options Prashanth:

1. write a simple smart device program that connects to the database and table by table writes out the rows in those tables to CSV files on device. copy the CSV files to the server and import into SQL Server.

2. there are third party tools that can connect to a SQL CE .SDF file on device and query their contents. DesktopSqlCe is available for download here: http://www.primeworks.pt/

3. convert your SQL CE database to a SQL Mobile database and connect to it from Visual Studio 2005 or SQL Server 2005 Management Studio (then select out your records into another SQL Server DB).

-Darren Shaffer|||

Darren,
Can you tell me how to move an .sdf file from sql ce to sql server. I want sdf table data to append with SQL Server's existing data. Is it posible?

Thnx

Raj

|||

With SQL CE, you can't do anything with the .SDF file on your server. You need to get the data out of SQL CE while it is still on a device or emulator and transport the data (not the .SDF file) to your SQL Server. I listed the options for this - it would be very quick to simply write a program that selects out the data from SQL CE and saves it in CSV files. You can then copy the CSV files from your device to your server and then import the data into SQL Server directly from the CSV files. A third party tool like RemoteSQLCE will also handle this for you.

-Darren

|||

Darren,

Thanks a lot for your suggestions, I was looking for tools to analyse sdf databases on a Windows XP environment for a long time!

- Jeroen Boiten

|||

Hallo, I'm Gabriel and I'm working with .NET 2005 and Pocket PC 2003.

I'm very very interested of first point, the one with the CSV export.Do you have an exemple ?

I'm very time stress.

Extracting Data from SQL CE SDF file

Hi,

I have written application for Pocket PC it stores data on SQL CE database with extension .sdf. I have added data to the table and synchronised to the SQl server. I got the data, then unfortunately i deleted the data in SQL Server, I want to extract the data again from .SDF file of Pocket PC.

Is this possible if not then how can i get the data from SDF to SQL Server

Its very urgent and waiting for early reply to following mail address
prashanthk@.mmi.ae

Regards,
Prashanththere are a couple of options Prashanth:

1. write a simple smart device program that connects to the database and table by table writes out the rows in those tables to CSV files on device. copy the CSV files to the server and import into SQL Server.

2. there are third party tools that can connect to a SQL CE .SDF file on device and query their contents. DesktopSqlCe is available for download here: http://www.primeworks.pt/

3. convert your SQL CE database to a SQL Mobile database and connect to it from Visual Studio 2005 or SQL Server 2005 Management Studio (then select out your records into another SQL Server DB).

-Darren Shaffer|||

Darren,
Can you tell me how to move an .sdf file from sql ce to sql server. I want sdf table data to append with SQL Server's existing data. Is it posible?

Thnx

Raj

|||

With SQL CE, you can't do anything with the .SDF file on your server. You need to get the data out of SQL CE while it is still on a device or emulator and transport the data (not the .SDF file) to your SQL Server. I listed the options for this - it would be very quick to simply write a program that selects out the data from SQL CE and saves it in CSV files. You can then copy the CSV files from your device to your server and then import the data into SQL Server directly from the CSV files. A third party tool like RemoteSQLCE will also handle this for you.

-Darren

|||

Darren,

Thanks a lot for your suggestions, I was looking for tools to analyse sdf databases on a Windows XP environment for a long time!

- Jeroen Boiten

|||

Hallo, I'm Gabriel and I'm working with .NET 2005 and Pocket PC 2003.

I'm very very interested of first point, the one with the CSV export.Do you have an exemple ?

I'm very time stress.

Extracting Data from SQL CE SDF file

Hi,

I have written application for Pocket PC it stores data on SQL CE database with extension .sdf. I have added data to the table and synchronised to the SQl server. I got the data, then unfortunately i deleted the data in SQL Server, I want to extract the data again from .SDF file of Pocket PC.

Is this possible if not then how can i get the data from SDF to SQL Server

Its very urgent and waiting for early reply to following mail address
prashanthk@.mmi.ae

Regards,
Prashanththere are a couple of options Prashanth:

1. write a simple smart device program that connects to the database and table by table writes out the rows in those tables to CSV files on device. copy the CSV files to the server and import into SQL Server.

2. there are third party tools that can connect to a SQL CE .SDF file on device and query their contents. DesktopSqlCe is available for download here: http://www.primeworks.pt/

3. convert your SQL CE database to a SQL Mobile database and connect to it from Visual Studio 2005 or SQL Server 2005 Management Studio (then select out your records into another SQL Server DB).

-Darren Shaffer|||

Darren,
Can you tell me how to move an .sdf file from sql ce to sql server. I want sdf table data to append with SQL Server's existing data. Is it posible?

Thnx

Raj

|||

With SQL CE, you can't do anything with the .SDF file on your server. You need to get the data out of SQL CE while it is still on a device or emulator and transport the data (not the .SDF file) to your SQL Server. I listed the options for this - it would be very quick to simply write a program that selects out the data from SQL CE and saves it in CSV files. You can then copy the CSV files from your device to your server and then import the data into SQL Server directly from the CSV files. A third party tool like RemoteSQLCE will also handle this for you.

-Darren

|||

Darren,

Thanks a lot for your suggestions, I was looking for tools to analyse sdf databases on a Windows XP environment for a long time!

- Jeroen Boiten

|||

Hallo, I'm Gabriel and I'm working with .NET 2005 and Pocket PC 2003.

I'm very very interested of first point, the one with the CSV export.Do you have an exemple ?

I'm very time stress.