hi,
instead of sqldataadapter you use the sqlcommand object as
com.commandtype=commandtype.storedprocedure
com.commandtext=storedprocedure name
dim dr as sqldatareader
dr=com.executenonquery
ItemList.DataSource = dr
ItemList.DataMember = "Items";
ItemList.DataBind();
asadeen <[EMAIL PROTECTED]> wrote:
I have a stored procedure as follows:
CREATE PROCEDURE dbo.sproc_ItemsSelect
@ListID int
AS
SELECT
FullName
FROM
[dbo].[Items]
WHERE
ListID = @ListID
GO
---------------------------------------------------
And the code that binds the value in list view is as follows.
private void btnSearch_Click(object sender, System.EventArgs e)
{
SqlCommand cmd = sqlConnection1.CreateCommand
();
cmd.CommandType =
CommandType.StoredProcedure;
cmd.CommandText = "sproc_ItemsSelect";
cmd.Parameters.Add(new SqlParameter
("@ListID",SqlDbType.Int));
cmd.Parameters["@ListID"].Value=
txtSearch.Text;
// data adapter
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
// data set
DataSet ds = new DataSet();
// filling dataset
da.Fill(ds, "Items");
ItemList.DataSource = ds;
ItemList.DataMember = "Items";
ItemList.DataBind();
}
---------------------------------------------------
I don't understand for what reason I am getting error as
"Exception Details: System.ArgumentOutOfRangeException: Specified
argument was out of the range of valid values. Parameter name: value"
---------------------------------
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! India Matrimony: Find your life partneronline.
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/