Re: DataAdapters and Parameters
- From: "Sahil Malik [MVP C#]" <contactmethrumyblog@xxxxxxxxxx>
- Date: Sat, 17 Dec 2005 14:05:19 -0500
> Does a parameterized DataAdapter automatically take care of this so I can
> use the following SQL without having to worry about blank textboxes?:
No. Your DataAdapter will work exactly per the SQL Statement you specify.
> Perhaps a DataReader is more appropriate for this?
I don't see why .. this factor is certainly not a consideration in choosing
between dataadapter or datareader.
> Presently, in my Access application, I've had to write a separate strSQL
> for
> each possible combination as to avoid creating a SQL statement with a
> blank
> parameter.
So you are using MS-Access? Try Like %xx%
> Additionally, since this will be an Intranet application which needs
> downtime backup, that is why I am currently working with Access. I'm
> hoping
> for the user to use SQL server while the intranet is up, and have a
> downtime
> backup of this info in an MDB file on their local hard drive.
I'm so confused. If this is an ASP.NET App, you shoudln't be using Access,
and if there is downtime - then the webserver is down - why bother with MS
Access?
- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
__________________________________________________________
"jonefer" <jonefer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:279689B7-9035-40B6-AE7D-649FE62446DD@xxxxxxxxxxxxxxxx
> I'm creating a simple search for Members, with possible 4 search
> parameters:
> Name, SSN, DOB, SEX, but (just beginning ASP.NET/VB.NET) I'm fearing that
> I
> will need to create a dataadapter for every possible combination of fields
> entered to eliminate a blank parameter.
>
> Does a parameterized DataAdapter automatically take care of this so I can
> use the following SQL without having to worry about blank textboxes?:
>
> SELECT * From Membership WHERE
> Name = @txtName AND
> SSN like @txtSSN AND
> DOB like @txtDOB AND
> SEX like @txtDOB
>
> Perhaps a DataReader is more appropriate for this?
>
> Presently, in my Access application, I've had to write a separate strSQL
> for
> each possible combination as to avoid creating a SQL statement with a
> blank
> parameter.
>
> Additionally, since this will be an Intranet application which needs
> downtime backup, that is why I am currently working with Access. I'm
> hoping
> for the user to use SQL server while the intranet is up, and have a
> downtime
> backup of this info in an MDB file on their local hard drive.
>
> Thanks so much for anything to help with this...
>
.
- Follow-Ups:
- Re: DataAdapters and Parameters
- From: jonefer
- Re: DataAdapters and Parameters
- Prev by Date: Re: DataSet.Merge() does not merge row and/or column errors in any cas
- Next by Date: Re: problem with merge and new row
- Previous by thread: Re: DataSet.Merge() does not merge row and/or column errors in any cas
- Next by thread: Re: DataAdapters and Parameters
- Index(es):
Relevant Pages
|