OracleDataAdapter.Fill and arithmetic overflow exception

Hi to all!
In my ASP.NET 2.0 web-application I use ODP.NET to working with Oracle DB. When I execute a pipelined stored procedure an "Arithmetic pverflow exception" occures. Here is exception stack trace:
в Oracle.DataAccess.Types.DecimalConv.GetDecimal(IntPtr numCtx)
в Oracle.DataAccess.Client.OracleDataReader.GetDecimal(Int32 i)
в Oracle.DataAccess.Client.OracleDataReader.GetValue(Int32 i)
в Oracle.DataAccess.Client.OracleDataReader.GetValues(Object[] values)
в System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object[] values)
в System.Data.ProviderBase.SchemaMapping.LoadDataRow()
в System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
в System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
в System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
в System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
в System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
в System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
If I call this stored procedure from SqlNavigator it works properly. Hovewer I see that the data of one column of result cursor looks like 55,58554033940333204184424641611784101. If I round data of this column, the Fill method of OracleDataAdapter works without any exceptions. How can i solve this problem?
Edited by: yoyoseek on Sep 3, 2008 2:09 AM

Hi
The reason you are seeing this, is because Oracle Number has a greater precision than .NET Decimal.
There are a couple of ways out:
* Convert manually to_char instead of number out.
* Using OracleDataAdapter.SafeMapping, described here http://stanford.edu/dept/itss/docs/oracle/10g/win.101/b10117/features009.htm
* Round down to the precision of .NET decimal before returning.
Morten
Edited by: gulhaugen on Sep 3, 2008 1:43 PM

Similar Messages

  • Arithmetic Overflow/Underflow and Divide by Zero Errors

    We're having problems similar to those posted below (see links), especially "Help: Divide by Zero Errors" to which no one has addressed. <br /><br />Here's our situation: On our form, we have two columns that sum the rows above them, called<br /><br />"covertotal" and "multtotal"<br /><br />...for which we need a final calculation: multtotal/covertotal<br /><br />Under calcutions in FormCalc, we have generated the following formula for the box called "prevtotal" under the calculate command: <br /><br />(multtotal / covertotal)<br /><br />However, since this calculation runs when the document is opened, we get a divide by zero error. Do we need to create an initialize or calculate formula to correct for this zero? If so, what is the proper coding.<br /><br />Please spell this out, we're that stupid... <sigh><br /><br />Thanks!<br /><br />Matthew<br /><br />Previous posts with similar problems are linked below:<br /><br />Help: Divide by Zero Errors<br /><a href="/cgi-bin/webx?14@@.3bbd2077">Harry Kontos, "Help: Divide by Zero Errors" #, 6 Nov 2005 10:01 pm</a><br /><br />calculations overflow/underflow<br />http://www.adobeforums.com/cgi-bin/webx/.3bbeb7e0<br /><br />FormCalc error-arithmetic overflow/underflow<br />http://www.adobeforums.com/cgi-bin/webx/.3bbc15f3

    Your error message indicates your script is being executed as FormCalc, not JavaScript.
    If you're using FormCalc try using an If statment to test for zero/null.
    if (tr>0) then (ac/tr)*100 endif

  • Re: (forte-users) FW: (forte-users) Overflow Exception thatIcan't catch

    Dave
    If you use #,##0.00 template, forte won't allow you to enter more than 28 numbers.
    Nat
    "Campbell, Dave" <DCampbellpurolator.com> 01/28 10:49 AM >>>Thanks Zenon,
    You mean... that without the aftervaluechange event, I could catch this?
    Because by no means is my exception block anchored to that event.
    I am looking for advice of where I could put this exception block...if there
    is another possible place at all.
    Thanks.
    Dave
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com
    -----Original Message-----
    Hi Dave,
    You have no chance to catch this exception in aftervaluechange block.
    This event is triggered if the value in DataField is OK.
    You get only Arithmetic exception without the aftervaluechange event if the
    length of the decimal is greater as 28.
    Regards
    Zenon Adamek
    Forte Developer
    Purolator Courier Ltd.
    ZAdamekpurolator.com
    -----Original Message-----
    From: Campbell, Dave [SMTP:DCampbellpurolator.com]
    Sent: Friday, January 28, 2000 8:19 AM
    To: 'kamranaminyahoo.com'
    Subject: (forte-users) Overflow Exception that I can't
    catch...
    The problem is:
    I have a DataField, mapped type :DecimalNullable
    the input mask is set to Template ( #,##0;;;;)
    Because it is Template I can't validate on keystroke and
    I can't set the max characters in the properties sheet.
    This works great until, Someone enters over 28 characters into the
    field.
    It then displays the errors:
    USER ERROR: Operation caused arithmetic overflow
    Class: qqsp_ArithmeticException
    Error #: [301, 7]
    Deteced at: DecimalData.SetScale at 1
    ErrorTime: Thu Jan 27 15:50:48
    Exception occurred (locally) on partition
    "PurolatorApplications_CL0_Client" ,(partitionId =
    DEB96B60-AA27-11D1-82A8-23E82A0FAA77:0X6f98:0x7, TASKiD =
    [DEB96B60-AA27-11D1-82A8-23E82A0FAA77:0X6f98:0x7.492] in
    application
    "FTLaunch_c10",pid 279 on node W5300109 in environment centrale
    This is the first bit of code that executes when I leave the field
    and the
    value has changed:
    when <est_daily_rev_amt>.aftervaluechange do
    Begin
    sys_upd_usr_nam = aUserProfileBO.user_nam;
    aCPVDetailItem.SetState(base_detailItem.CHANGED_STATE);
    Exception
    when ex:ArithmeticException Do
    Task.ErrMgr.Clear();
    Window.MessageDialog(
    messageText='Revenue amount can not exceed
    100,000,000',
    MessageType=MT_WARNING);
    Self.Window.PurgeEvents();
    End;
    This is what I do:
    I put a debugging stop on the "when line" and the "Exception line"
    I also set the debugger to stop on all exceptions and posts.
    It never reaches the above code!?
    Is this a forte bug?
    I need the template and I need it to be a decimalnullable.
    Is there any suggestions for where else I may catch this
    Exception???
    Thanks in advance
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Dave
    If you use #,##0.00 template, forte won't allow you to enter more than 28 numbers.
    Nat
    "Campbell, Dave" <DCampbellpurolator.com> 01/28 10:49 AM >>>Thanks Zenon,
    You mean... that without the aftervaluechange event, I could catch this?
    Because by no means is my exception block anchored to that event.
    I am looking for advice of where I could put this exception block...if there
    is another possible place at all.
    Thanks.
    Dave
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com
    -----Original Message-----
    Hi Dave,
    You have no chance to catch this exception in aftervaluechange block.
    This event is triggered if the value in DataField is OK.
    You get only Arithmetic exception without the aftervaluechange event if the
    length of the decimal is greater as 28.
    Regards
    Zenon Adamek
    Forte Developer
    Purolator Courier Ltd.
    ZAdamekpurolator.com
    -----Original Message-----
    From: Campbell, Dave [SMTP:DCampbellpurolator.com]
    Sent: Friday, January 28, 2000 8:19 AM
    To: 'kamranaminyahoo.com'
    Subject: (forte-users) Overflow Exception that I can't
    catch...
    The problem is:
    I have a DataField, mapped type :DecimalNullable
    the input mask is set to Template ( #,##0;;;;)
    Because it is Template I can't validate on keystroke and
    I can't set the max characters in the properties sheet.
    This works great until, Someone enters over 28 characters into the
    field.
    It then displays the errors:
    USER ERROR: Operation caused arithmetic overflow
    Class: qqsp_ArithmeticException
    Error #: [301, 7]
    Deteced at: DecimalData.SetScale at 1
    ErrorTime: Thu Jan 27 15:50:48
    Exception occurred (locally) on partition
    "PurolatorApplications_CL0_Client" ,(partitionId =
    DEB96B60-AA27-11D1-82A8-23E82A0FAA77:0X6f98:0x7, TASKiD =
    [DEB96B60-AA27-11D1-82A8-23E82A0FAA77:0X6f98:0x7.492] in
    application
    "FTLaunch_c10",pid 279 on node W5300109 in environment centrale
    This is the first bit of code that executes when I leave the field
    and the
    value has changed:
    when <est_daily_rev_amt>.aftervaluechange do
    Begin
    sys_upd_usr_nam = aUserProfileBO.user_nam;
    aCPVDetailItem.SetState(base_detailItem.CHANGED_STATE);
    Exception
    when ex:ArithmeticException Do
    Task.ErrMgr.Clear();
    Window.MessageDialog(
    messageText='Revenue amount can not exceed
    100,000,000',
    MessageType=MT_WARNING);
    Self.Window.PurgeEvents();
    End;
    This is what I do:
    I put a debugging stop on the "when line" and the "Exception line"
    I also set the debugger to stop on all exceptions and posts.
    It never reaches the above code!?
    Is this a forte bug?
    I need the template and I need it to be a decimalnullable.
    Is there any suggestions for where else I may catch this
    Exception???
    Thanks in advance
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • RE: (forte-users) FW: (forte-users) Overflow Exception thatI can't catc

    Nat,
    As I feared, This forces the user to enter decimals even if there are none.
    The Users Don't want this.
    So, i'm afraid i am back at beginning.. Trying to catch this exception..
    Thank you for your input.
    I would be happy to try anyone elses solution to this annoying issue.
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com
    Dave
    If you use #,##0.00 template, forte won't allow you to enter more than
    28 numbers.
    Nat
    "Campbell, Dave" <DCampbellpurolator.com> 01/28 10:49 AM >>>Thanks Zenon,
    You mean... that without the aftervaluechange event, I could catch this?
    Because by no means is my exception block anchored to that event.
    I am looking for advice of where I could put this exception block...if there
    is another possible place at all.
    Thanks.
    Dave
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com
    -----Original Message-----
    Hi Dave,
    You have no chance to catch this exception in aftervaluechange block.
    This event is triggered if the value in DataField is OK.
    You get only Arithmetic exception without the aftervaluechange event if the
    length of the decimal is greater as 28.
    Regards
    Zenon Adamek
    Forte Developer
    Purolator Courier Ltd.
    ZAdamekpurolator.com
    -----Original Message-----
    From: Campbell, Dave [SMTP:DCampbellpurolator.com]
    Sent: Friday, January 28, 2000 8:19 AM
    To: 'kamranaminyahoo.com'
    Subject: (forte-users) Overflow Exception that I can't
    catch...
    The problem is:
    I have a DataField, mapped type :DecimalNullable
    the input mask is set to Template ( #,##0;;;;)
    Because it is Template I can't validate on keystroke and
    I can't set the max characters in the properties sheet.
    This works great until, Someone enters over 28 characters into the
    field.
    It then displays the errors:
    USER ERROR: Operation caused arithmetic overflow
    Class: qqsp_ArithmeticException
    Error #: [301, 7]
    Deteced at: DecimalData.SetScale at 1
    ErrorTime: Thu Jan 27 15:50:48
    Exception occurred (locally) on partition
    "PurolatorApplications_CL0_Client" ,(partitionId =
    DEB96B60-AA27-11D1-82A8-23E82A0FAA77:0X6f98:0x7, TASKiD =
    [DEB96B60-AA27-11D1-82A8-23E82A0FAA77:0X6f98:0x7.492] in
    application
    "FTLaunch_c10",pid 279 on node W5300109 in environment centrale
    This is the first bit of code that executes when I leave the field
    and the
    value has changed:
    when <est_daily_rev_amt>.aftervaluechange do
    Begin
    sys_upd_usr_nam = aUserProfileBO.user_nam;
    aCPVDetailItem.SetState(base_detailItem.CHANGED_STATE);
    Exception
    when ex:ArithmeticException Do
    Task.ErrMgr.Clear();
    Window.MessageDialog(
    messageText='Revenue amount can not exceed
    100,000,000',
    MessageType=MT_WARNING);
    Self.Window.PurgeEvents();
    End;
    This is what I do:
    I put a debugging stop on the "when line" and the "Exception line"
    I also set the debugger to stop on all exceptions and posts.
    It never reaches the above code!?
    Is this a forte bug?
    I need the template and I need it to be a decimalnullable.
    Is there any suggestions for where else I may catch this
    Exception???
    Thanks in advance
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com

    Nat,
    As I feared, This forces the user to enter decimals even if there are none.
    The Users Don't want this.
    So, i'm afraid i am back at beginning.. Trying to catch this exception..
    Thank you for your input.
    I would be happy to try anyone elses solution to this annoying issue.
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com
    Dave
    If you use #,##0.00 template, forte won't allow you to enter more than
    28 numbers.
    Nat
    "Campbell, Dave" <DCampbellpurolator.com> 01/28 10:49 AM >>>Thanks Zenon,
    You mean... that without the aftervaluechange event, I could catch this?
    Because by no means is my exception block anchored to that event.
    I am looking for advice of where I could put this exception block...if there
    is another possible place at all.
    Thanks.
    Dave
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com
    -----Original Message-----
    Hi Dave,
    You have no chance to catch this exception in aftervaluechange block.
    This event is triggered if the value in DataField is OK.
    You get only Arithmetic exception without the aftervaluechange event if the
    length of the decimal is greater as 28.
    Regards
    Zenon Adamek
    Forte Developer
    Purolator Courier Ltd.
    ZAdamekpurolator.com
    -----Original Message-----
    From: Campbell, Dave [SMTP:DCampbellpurolator.com]
    Sent: Friday, January 28, 2000 8:19 AM
    To: 'kamranaminyahoo.com'
    Subject: (forte-users) Overflow Exception that I can't
    catch...
    The problem is:
    I have a DataField, mapped type :DecimalNullable
    the input mask is set to Template ( #,##0;;;;)
    Because it is Template I can't validate on keystroke and
    I can't set the max characters in the properties sheet.
    This works great until, Someone enters over 28 characters into the
    field.
    It then displays the errors:
    USER ERROR: Operation caused arithmetic overflow
    Class: qqsp_ArithmeticException
    Error #: [301, 7]
    Deteced at: DecimalData.SetScale at 1
    ErrorTime: Thu Jan 27 15:50:48
    Exception occurred (locally) on partition
    "PurolatorApplications_CL0_Client" ,(partitionId =
    DEB96B60-AA27-11D1-82A8-23E82A0FAA77:0X6f98:0x7, TASKiD =
    [DEB96B60-AA27-11D1-82A8-23E82A0FAA77:0X6f98:0x7.492] in
    application
    "FTLaunch_c10",pid 279 on node W5300109 in environment centrale
    This is the first bit of code that executes when I leave the field
    and the
    value has changed:
    when <est_daily_rev_amt>.aftervaluechange do
    Begin
    sys_upd_usr_nam = aUserProfileBO.user_nam;
    aCPVDetailItem.SetState(base_detailItem.CHANGED_STATE);
    Exception
    when ex:ArithmeticException Do
    Task.ErrMgr.Clear();
    Window.MessageDialog(
    messageText='Revenue amount can not exceed
    100,000,000',
    MessageType=MT_WARNING);
    Self.Window.PurgeEvents();
    End;
    This is what I do:
    I put a debugging stop on the "when line" and the "Exception line"
    I also set the debugger to stop on all exceptions and posts.
    It never reaches the above code!?
    Is this a forte bug?
    I need the template and I need it to be a decimalnullable.
    Is there any suggestions for where else I may catch this
    Exception???
    Thanks in advance
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com

  • Overflow Exception that I can't catch...

    The problem is:
    I have a DataField, mapped type :DecimalNullable
    the input mask is set to Template ( #,##0;;;;)
    Because it is Template I can't validate on keystroke and
    I can't set the max characters in the properties sheet.
    This works great until, Someone enters over 28 characters into the field.
    It then displays the errors:
    USER ERROR: Operation caused arithmetic overflow
    Class: qqsp_ArithmeticException
    Error #: [301, 7]
    Deteced at: DecimalData.SetScale at 1
    ErrorTime: Thu Jan 27 15:50:48
    Exception occurred (locally) on partition
    "PurolatorApplications_CL0_Client" ,(partitionId =
    DEB96B60-AA27-11D1-82A8-23E82A0FAA77:0X6f98:0x7, TASKiD =
    [DEB96B60-AA27-11D1-82A8-23E82A0FAA77:0X6f98:0x7.492] in application
    "FTLaunch_c10",pid 279 on node W5300109 in environment centrale
    This is the first bit of code that executes when I leave the field and the
    value has changed:
    when <est_daily_rev_amt>.aftervaluechange do
    Begin
    sys_upd_usr_nam = aUserProfileBO.user_nam;
    aCPVDetailItem.SetState(base_detailItem.CHANGED_STATE);
    Exception
    when ex:ArithmeticException Do
    Task.ErrMgr.Clear();
    Window.MessageDialog(
    messageText='Revenue amount can not exceed 100,000,000',
    MessageType=MT_WARNING);
    Self.Window.PurgeEvents();
    End;
    This is what I do:
    I put a debugging stop on the "when line" and the "Exception line"
    I also set the debugger to stop on all exceptions and posts.
    It never reaches the above code!?
    Is this a forte bug?
    I need the template and I need it to be a decimalnullable.
    Is there any suggestions for where else I may catch this Exception???
    Thanks in advance
    Regards,
    Dave Campbell
    Consultant,
    Caro Systems Inc.
    Mailto:Dave.CampbellCaroSys.com

    Hi Dave,
    did you try this:
    event loop
    Begin
    when ..... do
    when <est_daily_rev_amt>.aftervaluechange do
    when ..... do
    exception
    when ex:ArithmeticException Do
    End;
    end loop;
    As far as I remember it matters where you put Begin
    inside an event loop. This way you will catch the
    exception without dropping off the loop. If the value
    is O.K. the aftervaluechanged event will be executed.
    Hope that helps!
    Rumen
    Thanks Zenon,
    You mean... that without the aftervaluechange event,
    I could catch
    this?
    Because by no means is my exception block anchored to
    that event.
    I am looking for advice of where I could put this
    exception block...if
    there
    is another possible place at all.
    Thanks.
    Dave-----Original Message-----
    Hi Dave,
    You have no chance to catch this exception in
    aftervaluechange block.
    This event is triggered if the value in DataField is
    OK.
    You get only Arithmetic exception without the
    aftervaluechange event if
    the
    length of the decimal is greater as 28.
    Regards
    Zenon Adamek
    Forte Developer-----Original Message-----
    The problem is:
    I have a DataField, mapped >type :DecimalNullable
    the input mask is set to Template ( #,##0;;;;)
    Because it is Template I can't validate on
    keystroke and
    I can't set the max characters in the >propertiessheet.
    This works great until, Someone enters over >28characters into the
    field.
    It then displays the errors:
    USER ERROR: Operation caused arithmetic >overflow
    Class: qqsp_ArithmeticException
    Error #: [301, 7]
    Deteced at: DecimalData.SetScale at 1
    ErrorTime: Thu Jan 27 15:50:48
    Exception occurred (locally) on partition
    "PurolatorApplications_CL0_Client" ,(partitionId =
    DEB96B60-AA27-11D1-82A8->23E82A0FAA77:0X6f98:0x7,TASKiD = >
    [DEB96B60-AA27-11D1-82A8->23E82A0FAA77:0X6f98:0x7.492]
    in
    application
    "FTLaunch_c10",pid 279 on node W5300109 in
    environment centrale
    This is the first bit of code that executes >when Ileave the field
    and the
    value has changed:
    when <est_daily_rev_amt>.aftervaluechange do
    Begin
    sys_upd_usr_nam = >aUserProfileBO.user_nam;
    aCPVDetailItem.SetState(base_detailItem.CHANGED_STATE);
    Exceptionwhen ex:ArithmeticException Do
    Task.ErrMgr.Clear();
    Window.MessageDialog(
    messageText='Revenue amount >can not exceed
    100,000,000',
    MessageType=MT_WARNING);
    Self.Window.PurgeEvents();
    End;
    This is what I do:
    I put a debugging stop on the "when line" and >the"Exception line"
    I also set the debugger to stop on all >exceptionsand posts.
    It never reaches the above code!?
    Is this a forte bug?
    I need the template and I need it to be a
    decimalnullable.
    Is there any suggestions for where else I may >catchthis
    Exception???
    Thanks in advance__________________________________________________
    Do You Yahoo!?
    Talk to your friends online with Yahoo! Messenger.
    http://im.yahoo.com

  • Arithmetic Overflow Errors

    I remember that when Java was first introduced, one of the major design goals of the language was to eliminate common programmer errors. For example, instead of trusting the programmer to read the documentation of a given function to learn that they needed to test for a negative return value as an error, java included a very rigorous exception handling requirement. The developer who wrote a method would declare which exceptions it could throw and those using the method were required to account for those exceptions.
    I'm now starting to work with Java on a full time basis and was reviewing the arithmetic rules. I couldn't believe it when I discovered that overflowing an integer value doesn't cause an arithmetic overflow error!
    Am I missing something, or is that a major deviation from the stated language design goals?!

    David.Wendelken wrote:
    I remember that when Java was first introduced, one of the major design goals of the language was to eliminate common programmer errors. For example, instead of trusting the programmer to read the documentation of a given function to learn that they needed to test for a negative return value as an error, java included a very rigorous exception handling requirement.Uhhh... not quite - programmers do have to read the documentation nevertheless, because otherwise they don't know what the result of a call or valid parameters would be.
    The developer who wrote a method would declare which exceptions it could throw and those using the method were required to account for those exceptions.Yeah...
    I'm now starting to work with Java on a full time basis and was reviewing the arithmetic rules. I couldn't believe it when I discovered that overflowing an integer value doesn't cause an arithmetic overflow error!Why should it?
    Am I missing something, or is that a major deviation from the stated language design goals?!Your design goals are a little off. Nobody aimed to make Java to be usable without reading the docs/specs. They aimed at keeping things simple and cleanly designed, not exactly as self-explanatory. There are many things in the JLS that aren't.

  • If image file not exist in image path crystal report not open and give me exception error problem

    Hi guys my code below show pictures for all employees
    code is working but i have proplem
    if image not exist in path
    crystal report not open and give me exception error image file not exist in path
    although the employee no found in database but if image not exist in path when loop crystal report will not open
    how to ignore image files not exist in path and open report this is actually what i need
    my code below as following
    DataTable dt = new DataTable();
    string connString = "data source=192.168.1.105; initial catalog=hrdata;uid=sa; password=1234";
    using (SqlConnection con = new SqlConnection(connString))
    con.Open();
    SqlCommand cmd = new SqlCommand("ViewEmployeeNoRall", con);
    cmd.CommandType = CommandType.StoredProcedure;
    SqlDataAdapter da = new SqlDataAdapter();
    da.SelectCommand = cmd;
    da.Fill(dt);
    foreach (DataRow dr in dt.Rows)
    FileStream fs = null;
    fs = new FileStream("\\\\192.168.1.105\\Personal Pictures\\" + dr[0] + ".jpg", FileMode.Open);
    BinaryReader br = new BinaryReader(fs);
    byte[] imgbyte = new byte[fs.Length + 1];
    imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)));
    dr["Image"] = imgbyte;
    fs.Dispose();
    ReportDocument objRpt = new Reports.CrystalReportData2();
    objRpt.SetDataSource(dt);
    crystalReportViewer1.ReportSource = objRpt;
    crystalReportViewer1.Refresh();
    and exception error as below

    First: I created a New Column ("Image") in a datatable of the dataset and change the DataType to System.Byte()
    Second : Drag And drop this image Filed Where I want.
    private void LoadReport()
    frmCheckWeigher rpt = new frmCheckWeigher();
    CryRe_DailyBatch report = new CryRe_DailyBatch();
    DataSet1TableAdapters.DataTable_DailyBatch1TableAdapter ta = new CheckWeigherReportViewer.DataSet1TableAdapters.DataTable_DailyBatch1TableAdapter();
    DataSet1.DataTable_DailyBatch1DataTable table = ta.GetData(clsLogs.strStartDate_rpt, clsLogs.strBatchno_Rpt, clsLogs.cmdeviceid); // Data from Database
    DataTable dt = GetImageRow(table, "Footer.Jpg");
    report.SetDataSource(dt);
    crv1.ReportSource = report;
    crv1.Refresh();
    By this Function I merge My Image data into dataTable
    private DataTable GetImageRow(DataTable dt, string ImageName)
    try
    FileStream fs;
    BinaryReader br;
    if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + ImageName))
    fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + ImageName, FileMode.Open);
    else
    // if photo does not exist show the nophoto.jpg file
    fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + ImageName, FileMode.Open);
    // initialise the binary reader from file streamobject
    br = new BinaryReader(fs);
    // define the byte array of filelength
    byte[] imgbyte = new byte[fs.Length + 1];
    // read the bytes from the binary reader
    imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)));
    dt.Rows[0]["Image"] = imgbyte;
    br.Close();
    // close the binary reader
    fs.Close();
    // close the file stream
    catch (Exception ex)
    // error handling
    MessageBox.Show("Missing " + ImageName + "or nophoto.jpg in application folder");
    return dt;
    // Return Datatable After Image Row Insertion
    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

  • I need help, yesterday I installed and reinstalled the Yosemite system and take long to turn on my laptop, the bar takes to fill, and I'm worried. Can you help? thank

    I need help, yesterday I installed and reinstalled the Yosemite system and take long to turn on my laptop, the bar takes to fill, and I'm worried.
    Can you help? thank

    revert back to Maverick that is what I had to finally do. This was the worst upgrade I have ever seen. Hopefully you have Time Machine backup and can revert back. It was pretty painless except for a few issues. I will wait until Apple gets their stuff together on this upgrade or may never will.

  • 0FI_AR_4 Arithmetic overflow while extracting delta

    Hi All,
    While extracting 0FI_AR_4 delta from R/3 only data packages 2-4 were recieved in BW. Data package 1 is missing and the load was terminated with an error: "Arithmetic overflow error converting numeric to data type numeric.#3621 The statement has been terminated."
    Looking in RSA7 (in R/3 side) I can see all delta data waiting for Delta Repetition but can not locate any erroneous record (although I get "overflow" error when trying to sum one of the fields there. Sorting this field's values reveals nothing odd).
    Any idea as how to locate the bad record(s) , and as how to fix the problem?
    Thanks,
    OM

    Thank you Srinivas,
    I've checked ST22 log but besides listing the cause of the dump (Arithmetic overflow...) it gives no details as to the specific record / value / string.
    OM

  • CAST Not working for me - Arithmetic overflow error converting int to data type numeric - error

    GPM is DECIMAL(5,2)
    PRICE is DECIMAL(11,4)
    COST is DECIMAL(7,2)
    Trying to update the Gross Profit Margin % field and I keep getting the "Arithmetic overflow error converting int to data type numeric" error.
    UPDATE SMEMODETAIL SET SMD_GPM = (SMD_PRICE-SMD_COST) / SMD_PRICE * 100
    FROM SMEMODETAIL WHERE SMD_PRICE<>0 AND SMD_QUANTITY<>0
    Example record:
    SMD_PRICE    SMD_COST    GPM%
    1.8500            1.62                12.4324324324324300
    I added cast and I still get the error.
    How do I format to get this to work?
    Thanks!

    Hi GBerthume,
    The error is caused by some value such as 1000.01 of the expression (SMD_PRICE-SMD_COST) / SMD_PRICE * 100 exceeds the
    precision of the column(DECIMAL(5,2)). The example data doesn't cause the overflow error for the value of the expression is 12.43 which is in the scope of DECIMAL(5,2).
    USE TestDB
    CREATE TABLE SMEMODETAIL
    SMD_PRICE DECIMAL(11,4),
    SMD_COST DECIMAL(7,2),
    SMD_GPM DECIMAL(5,2)
    INSERT INTO SMEMODETAIL(SMD_PRICE,SMD_COST) SELECT 1.8500,1.62
    UPDATE SMEMODETAIL SET SMD_GPM = (SMD_PRICE-SMD_COST) / SMD_PRICE * 100
    FROM SMEMODETAIL WHERE SMD_PRICE<>0-- AND SMD_QUANTITY<>0
    SELECT * FROM SMEMODETAIL
    DROP TABLE SMEMODETAIL
    The solution of your case can be either scale the DECIMAL(5,2) or follow the suggestion in Scott_morris-ga's to check and fix your data.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Simple Round call results in Arithmetic overflow

    Hi,
    I'm a bit dazzled why this statement won't work in T-SQL : Select Round(9.990000, 0)
    The error I get is : Arithmetic overflow error converting expression to data type numeric.
    The result should be : 10
    I've tried this in SQL 2005,2008 and 2008 R2 (Error message if from R2), didn't find anything in BOL either
    Select ROUND(19.99, 0) works just fine
    Is this a bug or not? We develop accounting software and for us this is a dangerous bug.

    I can't be certain here, never having come across it before but I suspect that the number must have the same length in the "integer" part when you use ROUND like that.
    E.G. This works, giving "10" because the type is declared for the number.
    DECLARE @TEST AS FLOAT
    SET @TEST = 9.990000
    SELECT @TEST,Round(@TEST, 0)
    Whereas all of these fail
    SELECT Round(9.990000, 0)
    SELECT Round(99.990000, 0)
    SELECT Round(999.990000, 0)
    Do I make any sense here? :-)

  • Convert varchar to decimal - arithmetic overflow

    I'm using SQL Server 2014 and I'm trying to convert data from a staging table over to a production table. I seem to be getting an Arithmetic overflow error converting varchar to numeric on the decimal conversion. I'm sure I've overlooked something with the
    syntax of the CONVERT.
    This is the staging table:
    CREATE TABLE [dbo].[staging_table](
    [TimeIndex] [varchar](100) NULL,
    [Cluster] [varchar](100) NULL,
    [AvgMem] [varchar](100) NULL,
    [AvgCPU] [varchar](100) NULL,
    [TotalMemory] [varchar](100) NULL,
    [TotalCPU] [varchar](100) NULL,
    [Datacenter] [varchar](100) NULL,
    [vCenter] [varchar](100) NULL
    ) ON [PRIMARY]
    This is the prod table I'm moving it to:
    CREATE TABLE [dbo].[Clusters](
    [ClusterID] [int] IDENTITY(1,1) NOT NULL,
    [ClusterName] [varchar](25) NULL,
    [DatacenterName] [varchar](25) NULL,
    [TimeIndex] [datetime] NULL,
    [AvgCPU] [decimal](5, 2) NULL,
    [AvgMem] [decimal](5, 2) NULL,
    [TotalCPU] [decimal](8, 2) NULL,
    [TotalMem] [decimal](8, 2) NULL,
    [vCenterID] [int] NULL,
    CONSTRAINT [PK_Clusters_1] PRIMARY KEY CLUSTERED
    [ClusterID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    and here's an example INSERT INTO statement throwing the error:
    INSERT INTO [dbo].[Clusters] (ClusterName,DatacenterName,TimeIndex,AvgCPU,AvgMem,TotalCPU,TotalMem,vCenterID)
    SELECT SUBSTRING(Cluster,1,25) AS ClusterName,
    SUBSTRING(Datacenter,1,25) AS DatacenterName,
    CONVERT(datetime,TimeIndex,103) AS TimeIndex,
    CONVERT(decimal(5,2),AvgCPU) AS AvgCPU,
    CONVERT(decimal(5,2),AvgMem) AS AvgMem,
    CONVERT(decimal(8,2),TotalCPU) AS TotalCPU,
    CONVERT(decimal(8,2),TotalMemory) AS TotalMem,
    '3' FROM [dbo].[staging_table]
    Sample data is 0.00 to 100.00 in fields AvgCPU and AvgMem, and TotalCPU and TotalMem usually goes up to about 7 digits with no decimal (eg. 7543253) but could be 8 and although I've never seen a decimal I wouldn't rule it out so decided to account for it.
    I assume it's something I've overlooked with the syntax but any ideas would help.
    Thanks
    Adam

    The problem is your precision and scale you are assigning to your decimals.
    decimal(5,2) = this is a total of 5 digits, 3 digits for the whole number and 2 for the fractional.
    decimal(8,2) = this is a total of 8 digits, 6 digits for the whole number and 2 for the fractional. 
    So converting a varchar of 7 or 8 digits for TotalCPU or TotalMem will give you an error because your definition will actually only allow for 6 digits of storage. You could test this by doing decimal(8,0) or decimal(10,2) both which will allow for up to
    8 whole numbers.
    If you are worried about space Sql Server will allocate a set number of bytes for ranges based on the precision (first number in the parenthesis). See this page which explains in detail how much space each range takes up and also further details on
    decimal and numerics.
    -Igor

  • Database Udump & Cdump are getting filled and i am getting an error.

    Database Udump & Cdump are getting filled with the following erros in the " alert.log".
    ORA-07445: exception encountered: core dump [504152414c4c4540] [SIGSEGV] [Address not mapped to object] [0x504152414C4C4540] [] []
    ora-07445 exception encountered core dump sigsegv
    I am getting various erros with differeent numbers but all of them state ORA-07445. PLs help me how to solve this problem.

    882065 wrote:
    I do not want a look up tool or want to do an SR right away.. but I want to knw in detail if anyone had an issue like this I guess its more of hardware or something no unique fix for this problem yet I want know what can cause this issue because I have 5-6 instances on the server of different Db versions from 9.2.0.4 to 11.1.0.7 and all are having this same udump/cdump filling and alert log states abt the ORA-7445 error.Actually, you do want a lookup tool, and possibly an SR.
    Your bdump and cdump directories are likely filling up as a result of the trace files generated by the ORA-07445 errors. So, you need to find the cause of the 7445 errors to resolve that, then it will stop generating trace files and filling your directories.
    In the meantime, you can almost certainly delete some of the older files in both directories to make some space, but I would keep some of the newer ones since they may be valueable in diagnosing the cause of the 7445 errors.
    John

  • Getting stack overflow exception whilst reading from HashMap

    hi,
    We are getting stack oveflow exception exception whilst reading from the HashMap.
    Following are few details about the code
    We have a swing based client and Session beans and Entity beans deployed on Weblogic Server.
    When the server is started, a session bean method queries to data base and creates a java object for each row in the data base.This java object is then stored in HashMap. These java objects have all get/set methods . and it has attributes of primitive data type as well as other java objects.This Hahsmap is then returned to client.
    When client calls this method and the method processes succesfuly , but when tries to return the HashMap, it gives Stack overflow exception.
    Looking at the stack trace i think this exception is thrown when the HashMap.readObject() methods is being invoked.
    does any body have any idea about this ? a quick help is much appriciated.

    Stack overflow is often caused by infinity loops No, an infinite loop would be like while (true) {
        // stuff
    } That doesn't cause stack overflow.
    or
    recursive method calls.Bingo.

  • MBVOutPut Error PopulateFromRecordset, Err msg :Arithmetic overflow error

    Hi all
    We are experiencing technical difficulties. ie We have an Orchestration based Web Service,
    That sporadically consumes  lots of Memory.
    An Initial Analysis with Message Box Viewer.. Shows the following msg below.
    Any idea how one, can Interpret the message, locate and fix it?
    Thank in Advance
    ERROR : PopulateFromRecordset, Err msg :Arithmetic overflow error
    converting int to data type numeric. (STAGE : Executing SQL Query)
    MSGBOX DB 1 (MASTER) "BizTalkMsgBoxDb" on zx1000\BizTalkServer
    Col1
    NULL
    1 Rows
    AKE

    Here is part of the scenario.
    Type: = WCF-Basic-Http
    SOAP Action Header
    <BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" mlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Operation Name="StartInsertBizTalk" Action="http://schemas.myOpertion.com/StartInsertBizTalk" />
    Request response via Web Service
    Send Pipeline = XMLTransmit
    ReceivePipeline = XMLReceive.
    The Orchestration sends message
    We receives a response.. However, as soon as the response arrive.
    The message hangs and the process start consuming up to  8 Gig of memory.
    Hope it helps
    AKE

Maybe you are looking for

  • My iPod keeps thinking I'm using a new computer

    Since I bought my iPod Mini about 18 months ago I've had to format my hard drive several times as most people will do when Windows throws a wobbly every now and then. I keep backups off all my music and iTunes libraries. My problem is that my iPod wa

  • Over correction in Camera raw

    Hello, I have a problem with functionality of camera raw module 8.3 in Adobe CS6. The module is over correcting the RAW(.nef) images when selecting "Enable lens profile Corrections". The lens are selected right( nikon 24-70 2.8) but it's over correct

  • HT1473 Help!! No artists list available when I try to sync!

    I have created a new iTunes account as my ex had it on his old computer. However when I select the music tab to sync to my iPhone, the screen just gives me the only option to sync the entire music. It doesnt give me a list of artists to sync! I can s

  • Play/Pause button for embedded video

    I'm working with an embedded video file and have set up some basic controls. The client wants the play button to be able to go from Play to Pause and have the button visually do this as well. Currently I have one Play button and one Stop button. How

  • Is there color personalization in oracle portal

    Hi Is there ant color personalization in oracle portal. Is anybody has answer to this. Please let me know. Regards