Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: AW: Re: Problem in accessing the data


Message #1 by "Frank Tichy" <tichy@s...> on Thu, 8 Nov 2001 10:26:48 +0100
This is a multi-part message in MIME format.



------=_NextPart_000_0000_01C1683F.DF5989A0

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: 8bit



I had a similar problem once. All I had to do was to import the

corresponding assembly and dll.

It should look like this:

<% @Assembly name="System.Data.OleDb" %>

<% @Import namespace="System.Data.OleDb" %







hth



Frank



  -----Ursprüngliche Nachricht-----

  Von: Lalitha Shankar [mailto:lalithashank@h...]

  Gesendet: Donnerstag, 8. November 2001 03:27

  An: ASP+

  Cc: asifimam@y...

  Betreff: [aspx] Re: Problem in accessing the data





  When I include <%@ Import Namespace="System.Data.OleDb" %>, it gives an

error saying The type or namespace name 'OleDb' does not exist in the class

or namespace 'System.Data'



  OR



  When I give the select statement as : comm.CommandText = "select * from

address where FirstName = ' " + seltext " ' ";   it gives an error saying

(pointing to the select statement)--- An error occurred during the

compilation of a resource required to service this request. Please review

the specific error details below and modify your source code appropriately.



  Kindly help.





































  >From: "S. Asif Imam"

  >Reply-To: "ASP+"

  >To: "ASP+"

  >Subject: [aspx] Re: Problem in accessing the data

  >Date: Wed, 7 Nov 2001 19:03:22 +0500

  >

  > > comm.CommandText = "select * from address where FirstName 

  > > @seltext ";

  >--> @seltext "; this indicate a command parameter

  >correct will be either *******(using System.Data.OleDb;)*****

  >

  >comm.CommandText = "select * from address where FirstName = @seltext ";

  >comm.Parameters.Add (new OleDbParameter("@seltext", OleDbType.VarChar));

  >comm.Parameters["@seltext"].Value = seltext;

  >

  >OR

  >Directly specify the value in string like ..

  >

  >comm.CommandText = "select * from address where FirstName = ' " + seltext

"'

  >" ; //dont miss the single quotes..

  >

  >let me know if it problem persists.

  >

  >

  >

  >----- Original Message -----

  >From: "Lata Shah"

  >To: "ASP+"

  >Sent: Wednesday, November 07, 2001 11:15 AM

  >Subject: [aspx] Problem in accessing the data

  >

  >

  > > The WHERE clause does not seem to be working. Could anybody please

help me

  > > in debigging the code down below. I am pasting the code here:

  > >

  > > DISPLAY.ASPX

  > >

  > >

  > >

  > >

  > >

  Online Address Diary

  > >

  > >

  > > runat="server">

  > > > >  > >  Choose      : > >  > >

        > > FirstName

        > > LastName

        > > City

        > > Country

        > >

        > >  > >

    > >

  > >









  > > > >  > >  Enter here  : > >   > >

    > >

  > >







  > >

  > >

  > >

  > >

  > >

  > >

  > >

  > >

  > > ADDRESS1.ASPX

  > >

  > >

  > >

  > >

  > >

  > >

  > >

  > >

  > >

  > >

  > >

  > >

  > >

  > > Thanks,

  > > Lata.

  > >

  > > ---

  > > VBug Winter Conference 2001

  > >

  > > Open Forum: Dan Appleman will be hosting an open

  > > forum at The .NET Developer's Conference on

  > > 29th November 2001. The session will give

  > > developers the chance to discuss and question

  > > Dan on his experience with the .NET environment.

  > > Dan has been programming Visual Basic since the

  > > alpha version 1.0. And with over 10 years

  > > Visual Basic experience is well qualified to

  > > help you on your road to being a .NET Guru.

  > >

  > > http://www.vbug.co.uk/redirect.asp?url=39&id=17

  > >

  > > ---

  > > You are currently subscribed to

  > > aspx as: asifimam@y...


  > > $subst('Email.Unsub')

  >

  >

  >---

  >VBug Winter Conference 2001

  >

  >Open Forum: Dan Appleman will be hosting an open

  >forum at The .NET Developer's Conference on

  >29th November 2001. The session will give

  >developers the chance to discuss and question

  >Dan on his experience with the .NET environment.

  >Dan has been programming Visual Basic since the

  >alpha version 1.0. And with over 10 years

  >Visual Basic experience is well qualified to

  >help you on your road to being a .NET Guru.

  >

  >http://www.vbug.co.uk/redirect.asp?url=39&id=17

  >

  >---

  >You are currently subscribed to

  >aspx as: lalithashank@h...


  >$subst('Email.Unsub')





----------------------------------------------------------------------------

--

  Get your FREE download of MSN Explorer at http://explorer.msn.com

  ---

  VBug Winter Conference 2001



  Open Forum: Dan Appleman will be hosting an open

  forum at The .NET Developer's Conference on

  29th November 2001. The session will give

  developers the chance to discuss and question

  Dan on his experience with the .NET environment.

  Dan has been programming Visual Basic since the

  alpha version 1.0. And with over 10 years

  Visual Basic experience is well qualified to

  help you on your road to being a .NET Guru.



  http://www.vbug.co.uk/redirect.asp?url=39&id=17



  ---

  You are currently subscribed to

  aspx as: tichy@s...


  $subst('Email.Unsub')







  Return to Index