TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Devendra Kumar
NA
517
245.1k
passing the parameter in store procedur.
Jul 30 2016 8:31 AM
getting the error when passing the parameter in store procedur
<asp:GridView ID="grdOpen" runat="server" AutoGenerateColumns="false" CssClass="Grid"
DataKeyNames="transactionId" OnRowDataBound="OnRowDataBound" Height="284px"
Width="713px">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<img alt = "" style="cursor: pointer" src="../images/plus.png" />
<asp:Panel ID="pnlOrders" runat="server" Style="display: none">
<asp:GridView ID="grdOpendetails" runat="server" AutoGenerateColumns="false" CssClass = "ChildGrid">
<Columns>
<asp:BoundField ItemStyle-Width="150px" DataField="transactionId" HeaderText="Order Id" />
<asp:BoundField ItemStyle-Width="150px" DataField="Order Date" HeaderText="Date" />
<asp:BoundField ItemStyle-Width="150px" DataField="orderNumber" HeaderText="Order Id" />
<asp:BoundField ItemStyle-Width="150px" DataField="transaction_numbr" HeaderText="Date" />
</Columns>
</asp:GridView>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField ItemStyle-Width="150px" DataField="transactionId" HeaderText="Order Id" />
<asp:BoundField ItemStyle-Width="150px" DataField="orderNumber" HeaderText="Contact Name" />
<asp:BoundField ItemStyle-Width="150px" DataField="transaction_numbr" HeaderText="City" />
</Columns>
</asp:GridView>
bind nested gridview and then command
passing for inside grid view
protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string customerId = grdOpen.DataKeys[e.Row.RowIndex].Value.ToString();
GridView gvOrders = e.Row.FindControl("grdOpendetails") as GridView;
objMain.transaction_Id =Convert.ToInt16(customerId);
DataSet ds = objMain.SelectOrderdev();
gvOrders.DataSource = ds;
gvOrders.DataBind();
}
}
and my sp code is
public DataSet SelectOrderdev()
{
SqlParameter[] parameter = new SqlParameter[1];
parameter[0] = new SqlParameter("@transactionId", transaction_Id);
DataSet dst = SQLDataAccess.ExecuteDataset(SQLDataAccess.ConnectionString, CommandType.StoredProcedure, "Sp_SelectOrderReportdev");
return dst;
}
getting the error
Procedure or function 'Sp_SelectOrderReportdev' expects parameter '@transactionId', which was not supplied.
Reply
Answers (
1
)
Two same method in two different asp.net project
Regular expression exception