Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: doubt on oleDBDataAdapter


Message #1 by "Beulah Rebekah" <gbrebekah@y...> on Fri, 4 Jan 2002 06:16:30
This is my program.



<%@Page Language="VB"%>

<%@Import Namespace="System.Data"%>

<%@Import Namespace="System.Data.OleDb"%>

<script runat="server">

Sub Page_Load(obj as Object, e as EventArgs)

Dim myConnection as new OleDbConnection("Provider=SQLOLEDB;data 

source=localhost;initial catalog=net;UID=sa;pwd=;")

dim odbCmd = new OleDbCommand()

dim odbDA = new OleDbDataAdapter()

dim ds as DataSet = new DataSet()

odbCmd = new OleDbCommand("Calendar1", myConnection)

odbCmd.Parameters.Add(new OleDbParameter("FName", OleDbType.char,20))

odbCmd.Parameters("FName").Value = "Beulah"

odbDA = new OleDbDataAdapter(odbCmd)

ds = new DataSet()

odbDA.Fill(ds, "Calendar")

End sub

</script> 



My stored Procedure is :



alter procedure calendar1

(

@FName varchar(20)

)

as 

Begin



Select *

from calendar

where Username =@FName or Username = "All"

End



Error:

Procedure 'calendar1' expects parameter '@F...', which was not supplied. 



But I have already supplied the parameter and its value.Kindly help of 

where I went wrong.



thx in advance

Rebekah
Message #2 by Beulah Rebekah G <gbrebekah@y...> on Thu, 3 Jan 2002 23:25:05 -0800 (PST)
--0-772488904-1010129105=:13842

Content-Type: text/plain; charset=us-ascii





 

  Beulah Rebekah <gbrebekah@y...> wrote: This is my program.











Sub Page_Load(obj as Object, e as EventArgs)

Dim myConnection as new OleDbConnection("Provider=SQLOLEDB;data 

source=localhost;initial catalog=net;UID=sa;pwd=;")

dim odbCmd = new OleDbCommand()

dim odbDA = new OleDbDataAdapter()

dim ds as DataSet = new DataSet()

odbCmd = new OleDbCommand("Calendar1", myConnection)

odbCmd.Parameters.Add(new OleDbParameter("FName", OleDbType.char,20))

odbCmd.Parameters("FName").Value = "Beulah"

odbDA = new OleDbDataAdapter(odbCmd)

ds = new DataSet()

odbDA.Fill(ds, "Calendar")

End sub





My stored Procedure is :



alter procedure calendar1

(

@FName varchar(20)

)

as 

Begin



Select *

from calendar

where Username =@FName or Username = "All"

End



Error:

Procedure 'calendar1' expects parameter '@F...', which was not supplied. 



But I have already supplied the parameter and its value.Kindly help of 

where I went wrong.



thx in advance

Rebekah








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

Do You Yahoo!?

Send your FREE holiday greetings online at Yahoo! Greetings.



  Return to Index