Hi, here is the code to be exact:
Public Function GetActivity(ByVal dateFrom As Date, ByVal dateTo
As Date) As DataTable
Dim dt As New DataTable("Activity")
Static cmd As FbCommand
If cmd Is Nothing Then
cmd = CreateCommand("select id, snapdate, filename,
filesize, program, programcaption, duration from activity where
snapdate between @date1 and @date2 and filesize is not null order by
id")
cmd.Parameters.Add("@date1", FbDbType.TimeStamp)
cmd.Parameters.Add("@date2", FbDbType.TimeStamp)
cmd.Prepare()
End If
Dim da As New FbDataAdapter(cmd)
cmd.Parameters("@date1").Value = dateFrom
cmd.Parameters("@date2").Value = dateTo
da.Fill(dt)
Return dt
End Function
I don't think I'm doing anything wrong... can this be optimized in some way?
Is this problem because the interface of the embedded version fetches
only one row at a time? I've seen some old discussions here about
this...
On 1/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello:
>
> > When I'm running the query through the server, the query
> takes like
> > 0.1 sek but one second when I connect using the embedded
> version
>
> Well have in mind that when running a select query against the
> embedded server
> the rows are fetched one by one that means that there
> will be tons of PInvoke calls
> (the pinvoke is a simple way to
> implement the embedded server support but it has a
> performance penalty
> in every call)
>
> When you tell "I'm running the query through the
> server," what do you mean ??
> using isql ??
>
> Can you send a test case
> to show what you are doing ??
>
>
>
> --
> Best regards
>
> Carlos Guzmán Álvarez
> Vigo-Spain
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> _______________________________________________
> Firebird-net-provider mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
>
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider