Really I did not find out a similar example for my case. Could you pls point out why the event could not be fired/triggered from the Gridview? I'm sincere here to see your working example. Very sorry for bothering you for so long time.
<asp:SqlDataSource
ID="ds_job_det" Runat="server"
SelectCommand="select job_title title,to_char(start_dt,'dd-mm-rr') start_dt from user_past_jobs where user_id=:user_id"
UpdateCommand="update user_past_jobs set job_title=:title,start_dt=to_date(:start_dt,'dd-mm-rr') where user_id=:user_id"
ConnectionString="<%$ ConnectionStrings:OracleConnectionString %>"
ProviderName="System.Data.OracleClient" >
<SelectParameters>
<asp:SessionParameter Name="user_id" SessionField="sv_userid2" Type="Int32" Direction="Input" DefaultValue="0"/>
</SelectParameters>
</asp:SqlDataSource>
<div>
</div>
</form>
</body>
</html>
my_cv.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;
using System.Data.OracleClient;
namespace NewSite
{
public partial class my_cv : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
I really have a difficulty in solving this unbound error. If possible, could you pls see this?
Server Error in '/' Application.
ORA-01008: not all variables bound
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OracleClient.OracleException: ORA-01008: not all variables bound
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[OracleException (0x80131938): ORA-01008: not all variables bound
Many thanks Mak for your eager help each time for providing so many links to me. But I still do not have a clear way for solving this. As I've provided my codes, could you/any other eager experts pls try my case to see the problem one Oracle 10g DB (which
is very easy to have), if possible? You can just take your time. Great appreciations sincerely!
mudassarkhan
All-Star
78956 Points
13402 Posts
MVP
Re: Cannot convert type 'System.Web.UI.Control' to ...
May 26, 2009 08:28 AM|LINK
So still our problem hasn't resolved?
What issue you are facing?
Contact me
wmec
Contributor
6195 Points
3214 Posts
Re: Cannot convert type 'System.Web.UI.Control' to ...
May 26, 2009 08:40 AM|LINK
Do you mean you'll further help by saying this?
HuaMin Chen
mudassarkhan
All-Star
78956 Points
13402 Posts
MVP
Re: Cannot convert type 'System.Web.UI.Control' to ...
May 26, 2009 09:34 AM|LINK
The main issue of this thread is resolved I think
Hence I'll suggest start a new one and place your exact issue there
Contact me
wmec
Contributor
6195 Points
3214 Posts
Re: Cannot convert type 'System.Web.UI.Control' to ...
May 26, 2009 09:51 AM|LINK
HuaMin Chen
mudassarkhan
All-Star
78956 Points
13402 Posts
MVP
Re: Cannot convert type 'System.Web.UI.Control' to ...
May 26, 2009 10:51 AM|LINK
I have given tutorial links So an easy way to achieve download the code and see what you have missed
Contact me
wmec
Contributor
6195 Points
3214 Posts
Re: Cannot convert type 'System.Web.UI.Control' to ...
May 27, 2009 03:25 AM|LINK
Really I did not find out a similar example for my case. Could you pls point out why the event could not be fired/triggered from the Gridview? I'm sincere here to see your working example. Very sorry for bothering you for so long time.
HuaMin Chen
mudassarkhan
All-Star
78956 Points
13402 Posts
MVP
Re: Cannot convert type 'System.Web.UI.Control' to ...
May 27, 2009 06:15 AM|LINK
Here are some more
http://aspalliance.com/1125
http://geekswithblogs.net/AzamSharp/archive/2007/12/23/117947.aspx
http://www.123aspx.com/ReadReviews.aspx?res=36275
Contact me
wmec
Contributor
6195 Points
3214 Posts
Re: Cannot convert type 'System.Web.UI.Control' to ...
May 27, 2009 08:50 AM|LINK
Many many thanks Mak.
Here are the programs.
my_cv.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="my_cv.aspx.cs" Inherits="NewSite.my_cv" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>My CV</title>
</head>
<body>
<form id="form1" runat="server">
<br /><br />
<asp:GridView ID="gv1" runat="server" AutoGenerateColumns="false" Font-Size="Small" AllowSorting="True" DataSourceID="ds_job_det" >
<Columns>
<asp:CommandField ShowInsertButton="true" ShowEditButton="true"/>
<asp:BoundField DataField="title" HeaderText="Title" HtmlEncode="False" >
<HeaderStyle HorizontalAlign="Left" width="65px" />
<ItemStyle HorizontalAlign="Left" width="65px" />
</asp:BoundField>
<asp:BoundField DataField="start_dt" HeaderText="StartDate" HtmlEncode="False" >
<HeaderStyle HorizontalAlign="Left" width="65px" />
<ItemStyle HorizontalAlign="Left" width="65px" />
</asp:BoundField>
</Columns>
</asp:GridView>
<asp:SqlDataSource
ID="ds_job_det" Runat="server"
SelectCommand="select job_title title,to_char(start_dt,'dd-mm-rr') start_dt from user_past_jobs where user_id=:user_id"
UpdateCommand="update user_past_jobs set job_title=:title,start_dt=to_date(:start_dt,'dd-mm-rr') where user_id=:user_id"
ConnectionString="<%$ ConnectionStrings:OracleConnectionString %>"
ProviderName="System.Data.OracleClient" >
<SelectParameters>
<asp:SessionParameter Name="user_id" SessionField="sv_userid2" Type="Int32" Direction="Input" DefaultValue="0"/>
</SelectParameters>
</asp:SqlDataSource>
<div>
</div>
</form>
</body>
</html>
my_cv.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;
using System.Data.OracleClient;
namespace NewSite
{
public partial class my_cv : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ds_job_det_RowUpdating(object sender, EventArgs e)
{
LinkButton lnk = (LinkButton)sender;
GridViewRow curr_row = (GridViewRow)lnk.Parent.Parent;
ds_job_det.InsertParameters.Clear();
ds_job_det.InsertParameters.Add("title", curr_row.Cells[0].Text);
ds_job_det.InsertParameters.Add("start_dt", curr_row.Cells[1].Text);
ds_job_det.Insert();
}
}
}
You can have a table like this
create table user_past_jobs
(user_id number(15),
job_title varchar2(30),
start_dt date);
I really have a difficulty in solving this unbound error. If possible, could you pls see this?
Server Error in '/' Application.
ORA-01008: not all variables bound
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Data.OracleClient.OracleException: ORA-01008: not all variables bound
Source Error:
Stack Trace:
System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc) +304553System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals) +990System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid, OciRowidDescriptor& rowidDescriptor) +431System.Data.OracleClient.OracleCommand.ExecuteNonQuery() +115System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +386System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +325System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +92System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +907System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +704System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +123System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565</div>
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
HuaMin Chen
mudassarkhan
All-Star
78956 Points
13402 Posts
MVP
Re: Cannot convert type 'System.Web.UI.Control' to ...
May 27, 2009 09:02 AM|LINK
Read here
http://collecteddotnet.wordpress.com/2009/05/10/how-to-avoid-ora-01008-not-all-variables-bound-ora-01036-illegal-variable-namenumber-while-using-with-net/
Contact me
wmec
Contributor
6195 Points
3214 Posts
Re: Cannot convert type 'System.Web.UI.Control' to ...
May 27, 2009 09:22 AM|LINK
Many thanks Mak for your eager help each time for providing so many links to me. But I still do not have a clear way for solving this. As I've provided my codes, could you/any other eager experts pls try my case to see the problem one Oracle 10g DB (which is very easy to have), if possible? You can just take your time. Great appreciations sincerely!
HuaMin Chen