Hi!
Ive made this function based on an ex from Beg.asp.net. Its changed to be
using a stored procedure. It seems as if the SP: Query1 doesnt catch the
value of the variable ISBN. This I guess, because I use an almost
identical function to fill a dropdownlist, which later will supply the
value for the ISBN variable. The function which doesnt work looks like
this:
----------------
public function FuncQueryOne(ISBN as string) as DataSet
dim objConnection as New OleDbConnection(m_DSN)
objConnection.Open()
dim objCmd as New OleDbCommand()
objCmd.Connection=objConnection
objCmd.CommandText="[Query1]"
objCmd.CommandType = CommandType.StoredProcedure
dim myDataAdapter as New OleDbDataAdapter(objCmd)
dim DataSetTwo as New DataSet()
myDataAdapter.Fill(DataSetTwo, "Authors")
return DataSetTwo
objConnection.Close()
end function
-------------------
My CodeBehind file contains this in the Page_Load sub:
-------------------
DataGrid1.DataSource=objPubClassNameDLL.FuncQueryOne_
(DropDownList1.SelectedItem.Value)
DataGrid1.DataBind()
-------------------
As mentioned, the main difference of this func and the other one which
works, is the 'ISBN as String' variable.
Could anyone please show me whats wrong with my code?