Showing posts with label dataset. Show all posts
Showing posts with label dataset. Show all posts

Wednesday, March 21, 2012

Excluding filter via report parameter

Hi,

How to exclude a filter on a dataset such that I may either apply the filter or not?

I would like to control that through a boolean report parameter.

Edmund

try creating a stored procedure as your dataset. in the sp write an If statement. this lets you set up logic so thet a different query can be run e.g if "true" is selected query A is run filter applied

if "false" is selected query b can be run with no filter

Excluding duplicates after Multicast

I have to do various controls on a dataset - I created a multicast. After performing controls (one control per copy), I merge my (7) multicasted datasets using a Union All transformation. The problem I'm having are the duplicate rows created by merging the multicast copies.

How do I get rid of the duplicates? Is the Sort Transformation the solution by setting the option Remove rows with duplicate sort values to True? I have a unique key by which I'm able to discard the duplicates correctly. Are there any other ways (at a Union All level)? Is there sth like Union and Union All like in SQL?

I'm working on my 1st integration serv. project and it seems that more I work more questions I have. Shoudn't be the opposite? Thank you for the help.

See if the aggregate transformation can help you...

This paper has also some suggestions:

http://technet.microsoft.com/en-us/library/aa964137.aspx|||

Can you avoid creating duplicates in the first place? Perhpas the Conditional Split could be used instead of the Multicast?

I have found Sort to be the best de-duplication option, generally faster than the aggregate, but test it with your data if performance is an issue.

Excluding duplicates after Multicast

I have to do various controls on a dataset - I created a multicast. After performing controls (one control per copy), I merge my (7) multicasted datasets using a Union All transformation. The problem I'm having are the duplicate rows created by merging the multicast copies.

How do I get rid of the duplicates? Is the Sort Transformation the solution by setting the option Remove rows with duplicate sort values to True? I have a unique key by which I'm able to discard the duplicates correctly. Are there any other ways (at a Union All level)? Is there sth like Union and Union All like in SQL?

I'm working on my 1st integration serv. project and it seems that more I work more questions I have. Shoudn't be the opposite? Thank you for the help.

See if the aggregate transformation can help you...

This paper has also some suggestions:

http://technet.microsoft.com/en-us/library/aa964137.aspx|||

Can you avoid creating duplicates in the first place? Perhpas the Conditional Split could be used instead of the Multicast?

I have found Sort to be the best de-duplication option, generally faster than the aggregate, but test it with your data if performance is an issue.

Wednesday, March 7, 2012

Exception thrown: database file cannot be found

Hi,

I'm developing a desktop C# app that uses SQL Everywhere as an embedded database.
I generated strongly typed DataSet and use that to populate a DataGrid on my app.

When the app first loads, it populates the DataGrid with a line like this:

this.sTORE_INV_LNTableAdapter.Fill(this.inventoriesDataSet.STORE_INV_LN);

That all works fine. Later on, after adding more data to the database (through reading a csv file), I wanted to refresh the display on the DataGrid.

I used the same line of code:

this.sTORE_INV_LNTableAdapter.Fill(this.inventoriesDataSet.STORE_INV_LN);

however, this time, the following exception was thrown:

The database file cannot be found. Check the path to the database. [ File name = .\\Inventories.sdf ]

Does anyone know what may be going on? I saw this article about a bug in VS 2005 when using strongly typed DataSets (http://channel9.msdn.com/wiki/default.aspx/MobileDeveloper.DatabaseCannotBeFoundErrorInTypedDataset)
but that doesn't seem to apply here.

The connection string is identical both times that line of code is called so I'm a bit baffled with what's going on.

Any help would be appreciated. Thanks,

Jose

Windows CE does not support relative paths you're trying to use. You must specify correct absolute path to the database located on device file system.

Also keep in mind Windows CE does not have drive letters and can't see your desktop's C: (D:, etc) drive as many developers seem to believe.

|||I'm not running this on Windows CE. I'm trying out the new SQL Server Everywhere and using it on Windows XP.

Thanks though.|||

If file can not be found that's probably because it can't be found. You can use File.Exists() to verify that.

|||Thanks for the input!!

It sounds so simple and yet I hadn't thought about that. I kept looking for the complicated answer.

It turns out, my database file was there all along. The problem was, after opening and reading the CSV files to import into the db, the next time I tried to access the db the app was looking for the db file in the same directory where my CSVs where...and of course, it wasn't finding it.

So now, after reading a CSV and prior to re-querying the db, I use Directory.SetCurrentDirectory() to reset where the app looks for its db.

Thanks for the help, I had been stumped by this for a week.

-Jose|||

this one has had me scratching my head for a day so I'm glad I haven't spent a week...

I'm using a separate project as a class library with a *.sdf database so it can be re-used for several projects.

I had the exact problem, everything was good until I opened OpenFileDialog(), then things went south after that.

Just a note to your solution... (maybe you do this already)...but you can assign the OpenFileDialog.RestoreDirectory flag to true and then after it closes the original directory will be restored prior to the open dialog....that way you don't need the Directory.SetCurrentDirectory.

fileChooser = new OpenFileDialog();

fileChooser.RestoreDirectory = true;

gl

Exception thrown: database file cannot be found

Hi,

I'm developing a desktop C# app that uses SQL Everywhere as an embedded database.
I generated strongly typed DataSet and use that to populate a DataGrid on my app.

When the app first loads, it populates the DataGrid with a line like this:

this.sTORE_INV_LNTableAdapter.Fill(this.inventoriesDataSet.STORE_INV_LN);

That all works fine. Later on, after adding more data to the database (through reading a csv file), I wanted to refresh the display on the DataGrid.

I used the same line of code:

this.sTORE_INV_LNTableAdapter.Fill(this.inventoriesDataSet.STORE_INV_LN);

however, this time, the following exception was thrown:

The database file cannot be found. Check the path to the database. [ File name = .\\Inventories.sdf ]

Does anyone know what may be going on? I saw this article about a bug in VS 2005 when using strongly typed DataSets (http://channel9.msdn.com/wiki/default.aspx/MobileDeveloper.DatabaseCannotBeFoundErrorInTypedDataset)
but that doesn't seem to apply here.

The connection string is identical both times that line of code is called so I'm a bit baffled with what's going on.

Any help would be appreciated. Thanks,

Jose

Windows CE does not support relative paths you're trying to use. You must specify correct absolute path to the database located on device file system.

Also keep in mind Windows CE does not have drive letters and can't see your desktop's C: (D:, etc) drive as many developers seem to believe.

|||I'm not running this on Windows CE. I'm trying out the new SQL Server Everywhere and using it on Windows XP.

Thanks though.

|||

If file can not be found that's probably because it can't be found. You can use File.Exists() to verify that.

|||Thanks for the input!!

It sounds so simple and yet I hadn't thought about that. I kept looking for the complicated answer.

It turns out, my database file was there all along. The problem was, after opening and reading the CSV files to import into the db, the next time I tried to access the db the app was looking for the db file in the same directory where my CSVs where...and of course, it wasn't finding it.

So now, after reading a CSV and prior to re-querying the db, I use Directory.SetCurrentDirectory() to reset where the app looks for its db.

Thanks for the help, I had been stumped by this for a week.

-Jose
|||

this one has had me scratching my head for a day so I'm glad I haven't spent a week...

I'm using a separate project as a class library with a *.sdf database so it can be re-used for several projects.

I had the exact problem, everything was good until I opened OpenFileDialog(), then things went south after that.

Just a note to your solution... (maybe you do this already)...but you can assign the OpenFileDialog.RestoreDirectory flag to true and then after it closes the original directory will be restored prior to the open dialog....that way you don't need the Directory.SetCurrentDirectory.

fileChooser = new OpenFileDialog();

fileChooser.RestoreDirectory = true;

gl

Friday, February 24, 2012

Excel to XML to Dataset to SQL - As HTML

Main goal is to parse an Excel Worksheet and save it as a HTML table to SQL.

I have a web form (aspx) where a use is able to browse and upload an excel documnt. I then select the data from the worksheet and use a OleDBDataAdapter to build a Dataset from the Excel data. I fill the dataset with the data from the Excel document.

What I need to do from this point has me lost. I need to re-engineer the excel data into a HTML table to display within a orgianl asp code. I was planning to build the html table...save it as a large string to SQL database table. And then from asp page - read the table and re-display it.

Im not sure how to do this...anyone with experinece, please help.

Other things I have tried. After I have the excel data saved in the dataset...I can read it via Readxml and display it within the asp.net code. So, I dont knwo if it is possible to save this dataset information as HTML to a string...?

Anyone...please|||

Why not save the Excel as XML instead of HTML to SQL database? As I know you can display XML document in HTML form by using XSLT. So I prefer to save the XML documents as BLOB data into SQL database. You can push the XML data as binary array into SQL Server.

If you're using SQL2005, you can load XML files (actually all BLOB data, including images) into SQL database by using simply OPENROWSET with SINGLE_BLOB option. You can take a look at:

http://msdn.microsoft.com/library/en-us/dnsql90/html/sql2k5xml.asp?frame=true