Search found 8 matches

by khanh
Fri 13 Nov 2020 17:25
Forum: dotConnect for SQLite
Topic: sqlite insertRow question!
Replies: 4
Views: 10308

Re: sqlite insertRow question!

Hi shalex,
question1: I made a few mistakes when there was more than one data type in the column, now parametercheck works as I expected
question2: thanks for the clarification, your answers helped me a lot.
My problem has been solved! Many thanks.
by khanh
Wed 11 Nov 2020 13:52
Forum: dotConnect for SQLite
Topic: sqlite insertRow question!
Replies: 4
Views: 10308

Re: sqlite insertRow question!

Hi shalex, your code worked for me.
more question:
I am using the paramtercheck feature:
however it did not detect the Text type even though all my settings for the column are text and its value is clearly text.
my image:
https://prnt.sc/vhf4za

I had to use your way: parameters.add (.., sqlite.type) .value =.. to work!
I mean parametercheck probably won't recognize the data type?

question2: I'm using transaction, assuming I have 25k rows of data so, can i pass them all to the table and then commit only once?
Or do I need to split them up, say 2,500 rows and commit 10 times?
(The reason is I read it somewhere need to split them to running faster..)
Please help me clarify this problem!
by khanh
Sat 07 Nov 2020 14:10
Forum: dotConnect for SQLite
Topic: sqlite insertRow question!
Replies: 4
Views: 10308

sqlite insertRow question!

Hi,
From this https://www.devart.com/dotconnect/oracl ... mmand.htmlit seems unclear.

I am wanting to add multiple rows to the sqlite table.
I have tried the following 2 pieces code but only the first row in my table added. Can you clarify more?
X
sqlitecommand.CommandText ="INSERT INTO " ...
//row1:
sqlitecommand.Parameters.Add("param1", number(1))
sqlitecommand.Parameters.Add("param2", number(2))
//row2:
sqlitecommand.Parameters.Add("param1", number(3))
sqlitecommand.Parameters.Add("param2", number(4))
....
sqlitecommand.ExecuteNonQuery()

ex2
//row1:
sqlitecommand.CommandText ="INSERT INTO " ...
sqlitecommand.Parameters.Add("param1", number(1))
sqlitecommand.Parameters.Add("param2", number(2))

sqlitecommand.ExecuteNonQuery()
//row2:
sqlitecommand.CommandText ="INSERT INTO " ...
sqlitecommand.Parameters.Add("param1", number(3))
sqlitecommand.Parameters.Add("param2", number(4))
sqlitecommand.ExecuteNonQuery()
by khanh
Fri 06 Nov 2020 10:39
Forum: dotConnect for SQL Server
Topic: X-question about sqlserver!
Replies: 2
Views: 17611

Re: X-question about sqlserver!

Hi shalex,
I will try to change some settings.
Thanks for the confirmation!
by khanh
Fri 06 Nov 2020 04:28
Forum: dotConnect for SQL Server
Topic: X-question about sqlserver!
Replies: 2
Views: 17611

X-question about sqlserver!

Hi, I'm creating my custom add-in with help from dotconnect sqlserver
I finished it but I want to ask if it could be even faster!
I have several tables that need to be queried in turn. (numbers of rows , columns and column data type are specified) so I only need to create a single table in specify datatbase .mdf file.
My steps are as follows:
step1: convert my table to datatable
step2: using devart.sqlscript to create table in .mdf file
step3: using devart.bulkcopy to add datatable
my question is:
1. Is there any faster method?
+, Can the above steps be more concise? (Is it possible to record quickly by skipping step 1 and write directly to step 3?)
+, Is there any devart tool (here I just know devartconnect) can do it better?
+, I just need to move the table to some database and query this table and want the fastest execution speed!
Is it best to use the .mdf file? What kind of database file should I choose?
If I use .dot connect, what tips and tricks do I have to speed up the fastest queries?
Thanks so much!
by khanh
Sat 25 Apr 2020 10:44
Forum: dotConnect for SQL Server
Topic: Linq sample code for ado.net - sql server?
Replies: 3
Views: 12080

Re: Linq sample code for ado.net - sql server?

Thanks shalex, i got it.
by khanh
Tue 14 Apr 2020 02:33
Forum: dotConnect for SQL Server
Topic: Linq sample code for ado.net - sql server?
Replies: 3
Views: 12080

Re: Linq sample code for ado.net - sql server?

I have just tested dotconnect for sqlserver, I would like to ask if I use the query multiple times, what should I do to improve performance, such as creating a virtual table or stored procedure, objectquery or querystring cache, ... I Not sure exactly what will help ?
by khanh
Mon 13 Apr 2020 21:28
Forum: dotConnect for SQL Server
Topic: Linq sample code for ado.net - sql server?
Replies: 3
Views: 12080

Linq sample code for ado.net - sql server?

I have a project vsto with sql server, and I want to use ado.net to read and write data to it because I want to create dynamic queries when using linq.
I am fairly new with sql and linq. I would like to ask if devart provide some basic code samples to access reading, writing even formula in the query (such a query string: "Select left(Column1,3) from Table1")

I mean I want to customize the query string more,
ex: get the header or not, support formula sum, average, etc. (if I'm using dotconnect for sql server then can I access these Canonical Functions? )

if they don't already exist and I have to build by myself whether I should choose devart linq to sql or entity framework? . Mostly my work is reporting but not too complicated, I will load all the data into sql database and customize the data to report through the query string.

Thank you!