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

Monday, March 26, 2012

Load a Dataset to SQL Mobile (Quickly)

I have five small tables that I need to insert to a SQL CE database.

I am using the 2.0 Compact Framework with the 2.0 System.Data.SqlServerCe.

My table definition is dynamic so I never know it's design.

1- If I go Row by Row using an this.ExecuteNonQuery(_global, par); it takes about 26 seconds to insert 5 tables of 330 rows.

2- If a use

StringBuilder sbColumns = new StringBuilder();

foreach (DataColumn dc in table.Columns)

{

if (sbColumns.ToString() != "")

sbColumns.Append(",");

sbColumns.Append(dc.ColumnName);

}

SqlCeDataAdapter da = new SqlCeDataAdapter("SELECT " + sbColumns.ToString() + " FROM " + _tablename, m_con);

SqlCeCommandBuilder cb = new SqlCeCommandBuilder(da);

da.MissingMappingAction = MissingMappingAction.Passthrough;

da.InsertCommand = cb.GetInsertCommand();

da.Update(table);

da.Dispose();

it takes about 46 seconds.

How Can write it faster or is this fastest it can go?

Thanks

You can use SqlCeResultset, which will be the fastet option in .NET. see http://msdn2.microsoft.com/en-us/library/system.data.sqlserverce.sqlceresultset.aspx

You can find details in this excellent article by Joao: http://www.pocketpcdn.com/articles/articles.php?&atb.set(c_id)=74&atb.set(a_id)=11003&atb.perform(details)=&

Llimit on Lines of code in Query Builder

Does anyone know if there is a limit on characters or lines of code that can be used to create your dataset?

I cut and pasted some sql code of a report in there and it's cutting off the last 100 lines or so.

If you select the report in the solution explorer, right click and 'view code', you can then find your dataset in the rdl and insert the sql directly in there.

Monday, March 19, 2012

list with grouping loses space between records

hi,
I'm new to reporting services and have had a play with it but wonder if
I can get a quick answer here.
I have a dataset and want to show some details of the parent record
with some details of the child.
I have used a table and that is all ok except for the fact that on the
child record I have table headings (which I have put into the parent
grouping row). Now this row expands because of the data in the parent
record which means that the child record doesn't start until after the
parent record. I want the child record to show as a table with its
headers in line with the parent record i.e. the table headers will be
independent of the parent record - not growing.
So I decided to try and use a list. This works as I want except now, I
am not sure how to get a gap between the records. When there are no
child records I get a nice gap but if there are, say 3 child records,
then the gap between the last child record and the next parent record
is virtually non-existent. I have tried putting empty rectangles in and
even an empty textbox with a "CanShrink=False" to try and force a
certain gap between parent records but there's probably something
really basic I'm missing.
Thanks for any help
Philactually the list doesn't work as i want because each of the cells
grows independently of each other so the borders don't align - is there
a way round this?

Friday, February 24, 2012

List Filtering NOT Working

I have a Report where i want to show in a DataList only those values Filtered by one of the fields of my dataset. I want to show a Date value ONLY if another column value in that row in my dataset = "IN".

But nothing seems to happen here. No records are shown. It's like the condition is never true.

Steps:

1. I drag a DataList

2. I drag a DatasetField inside the DataList (automatically creates a textbox)

3. Right Click on the Datalist, Properties, then Filter Tab

I use the following statement on the Filter tab

=Cstr(Fields!TransactionType.Value) Like "IN"

or

=Cstr(Fields!TransactionType.Value) = "IN"

it doesnt work at all.

Does anyone knows what's going on?

Thanks

Jose

I've noticed that in filtering sometimes, in fact in most cases, I have to explicitly cast each side to the correct data type. So in your case

Expression: Operator: Value:

=Cstr(Fields!TransactionType.Value) = = Cstr("IN")

Hope this helps.

|||

PERFECTLY FINE

THANK YOU

Monday, February 20, 2012

List & Dataset

Hi,
i have two matrix in two different lists with two different dataset. i would
like to know if it is posible to put one of the list into another list?
Please advice.
For example, i have a item table with the item no ,price and sub item, item
is unique, and i have another table which has the subitem no and item
features, each item might have multiple row of feature.
let say:
Table 1
--
item price subitem
A 2.50 AA
B 1.50 AA
C 1.00 BB
D 2.00 AA
E 1.00 CC
Table 2
--
subitem feature
AA a
AA b
AA c
BB t
C y
i would like to display
--
subitem: AA
feature : a
b
c
--
item: A 2.50
B 1.50
D 2.00
--
subitem: BB
feature : t
--
item: C 1.00
--
subitem: CC
feature : y
--
item: E 1.00
--
i tried to link the two table together as one, it will display duplicate
item, like below
item price subitem features
A 2.50 AA a
A 2.50 AA b
A 2.50 AA c
B 1.50 AA a
B 1.50 AA b
B 1.50 AA c
C 1.00 BB t
D 2.00 AA a
D 2.00 AA b
D 2.00 AA c
E 1.00 CC y
and the result will be
--
subitem: AA
feature : a
b
c
--
item: A 2.50
A 2.50
A 2.50
B 1.50
B 1.50
B 1.50
D 2.00
D 2.00
D 2.00
--
subitem: BB
feature : t
--
item: C 1.00
--
subitem: CC
feature : y
--
item: E 1.00
--
or any idea to make the item to be distinct?On May 10, 5:53 pm, SL <S...@.discussions.microsoft.com> wrote:
> Hi,
> i have two matrix in two different lists with two different dataset. i would
> like to know if it is posible to put one of the list into another list?
> Please advice.
> For example, i have a item table with the item no ,price and sub item, item
> is unique, and i have another table which has the subitem no and item
> features, each item might have multiple row of feature.
> let say:
> Table 1
> --
> item price subitem
> A 2.50 AA
> B 1.50 AA
> C 1.00 BB
> D 2.00 AA
> E 1.00 CC
> Table 2
> --
> subitem feature
> AA a
> AA b
> AA c
> BB t
> C y
> i would like to display
> --
> subitem: AA
> feature : a
> b
> c
> --
> item: A 2.50
> B 1.50
> D 2.00
> --
> subitem: BB
> feature : t
> --
> item: C 1.00
> --
> subitem: CC
> feature : y
> --
> item: E 1.00
> --
> i tried to link the two table together as one, it will display duplicate
> item, like below
> item price subitem features
> A 2.50 AA a
> A 2.50 AA b
> A 2.50 AA c
> B 1.50 AA a
> B 1.50 AA b
> B 1.50 AA c
> C 1.00 BB t
> D 2.00 AA a
> D 2.00 AA b
> D 2.00 AA c
> E 1.00 CC y
> and the result will be
> --
> subitem: AA
> feature : a
> b
> c
> --
> item: A 2.50
> A 2.50
> A 2.50
> B 1.50
> B 1.50
> B 1.50
> D 2.00
> D 2.00
> D 2.00
> --
> subitem: BB
> feature : t
> --
> item: C 1.00
> --
> subitem: CC
> feature : y
> --
> item: E 1.00
> --
> or any idea to make the item to be distinct?
I would suggest handling this in the stored procedure/query that is
sourcing the report. You will most likely want to look into your
grouping setup.
Regards,
Enrique Martinez
Sr. Software Consultant|||The result is come from store procedure. As i said in the previous post, i
can either seperate into two dataset or combine two into one dataset which
will cause duplication. The duplication cannot be avoid in store procedure
because i need all the data, just that when i display them, i need to be
distinct. My question is that if it is possible to insert a list with
dataset1 into another list which has diff dataset, dataset2?|||Yes, you want subreports. The second report has a single list on it.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"SL" <SL@.discussions.microsoft.com> wrote in message
news:7CC9ACC7-4073-4DCD-BE1A-3FB7A4A9E29A@.microsoft.com...
> The result is come from store procedure. As i said in the previous post, i
> can either seperate into two dataset or combine two into one dataset which
> will cause duplication. The duplication cannot be avoid in store procedure
> because i need all the data, just that when i display them, i need to be
> distinct. My question is that if it is possible to insert a list with
> dataset1 into another list which has diff dataset, dataset2?
>