Re: code sharing for sql2k and sql-ce

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Darren Shaffer (darrenshaffer_at_discussions.microsoft.com)
Date: 12/15/04


Date: Wed, 15 Dec 2004 12:26:48 -0700

I think the idea of coding against an interface is perfect given what you're
trying to do.
I'd expose methods through the interface like "ExecuteQuery",
"ExecuteNonQuery",
and have overloads for the ExecuteNonQuery that allows one to do
transactional and
non-transactional updates/inserts. You should not have to put SQL in your
web-based
code - there is no way you are going to access SQL CE from ASP.Net pages, so
why
not treat the web interface to your SQL Server database as a separate part
of your
architecture and push the SQL into Stored Procedures or some middle-tier
entity?

-Darren Shaffer

"almir" <kazazic@gmail.com> wrote in message
news:1103131168.324595.228630@c13g2000cwb.googlegroups.com...
> Thank you Darren,
>
> I am not using any but basic data types (varchar and int) so I suppose
> this is not going to be a problem and database is not going to be
> big(each user will have only his/her data) and no complicated queries,
> which should mitigate index problem .
>
>
> I made a small data access layer which is working with IDbCommand , and
> depending of environment I am returning SqlCeCommand or SqlCommand but
> using IDbParameter could produce some really strange bugs as position
> of parameter must be the same as cmd.Parameters.Add(); which is
> something I do not want to test.
>
> So it seams that I will have to use sql statement in source code, only
> this way I can use same statements and code for both DBMS and this is
> not good thing to do in a web application (which is another place where
> this app is going to be used) But it seams that I will have to do it
> this way, or write it twice.
>
>
> Are this things ok (as this is my first project in CE environment)
>
> Thank you once more
> Almir
>
> Ps
> I am using c# but this should make no difference
>



Relevant Pages

  • Re: Cant get record to insert into Access
    ... put your ExecuteNonQuery in a try/Catch block and write ... That's the best way to catch SQL syntax errors. ... >Here's a generated sql statement. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Application, database and schema?
    ... > hardware interface for the monitoring. ... This subsystem understands how to talk to the ... > this case an RDB with a SQL interface. ...
    (comp.object)
  • RE: open a text file using sp_oamethod
    ... sp_OAGetProperty Fails on Properties From Inherited Interface ... Source: ODSOLE Extended Procedure ... When no OUTPUT parameter is supplied, ... Microsoft has confirmed this to be a problem in SQL Server 7.0. ...
    (microsoft.public.sqlserver.programming)
  • Re: Opinions on approach, please...
    ... Write the where clause manually, ... MOST interface, with the original COBOL ISAM access commented out above it. ... I can certainly do it with dynamic SQL and MOST can build a WHERE statement ... application is doing lengthy sequential processing, how often, in what ...
    (comp.lang.cobol)
  • Re: Putting data in SQL server ?
    ... web interface while keeping the MDB frontend. ... the data into SQL server. ... regarding such a conversion? ...
    (microsoft.public.access.tablesdbdesign)