Click here to Skip to main content
15,882,802 members
Home / Discussions / C#
   

C#

 
GeneralRe: drawing circles. Pin
dan!sh 28-Jun-09 22:46
professional dan!sh 28-Jun-09 22:46 
GeneralRe: drawing circles. Pin
_AnsHUMAN_ 28-Jun-09 23:12
_AnsHUMAN_ 28-Jun-09 23:12 
GeneralRe: drawing circles. Pin
dan!sh 28-Jun-09 23:36
professional dan!sh 28-Jun-09 23:36 
RantRe: drawing circles. Pin
musefan29-Jun-09 2:38
musefan29-Jun-09 2:38 
QuestionTimed License Pin
anishkannan28-Jun-09 18:45
anishkannan28-Jun-09 18:45 
AnswerRe: Timed License Pin
musefan29-Jun-09 2:41
musefan29-Jun-09 2:41 
AnswerRe: Timed License Pin
LogicNP Software10-Jul-09 19:21
LogicNP Software10-Jul-09 19:21 
QuestionOracle ODP.NET "ORA-06502: PL/SQL: numeric or value error: character string buffer too small" [modified] Pin
devvvy28-Jun-09 18:19
devvvy28-Jun-09 18:19 
Hello

I am running into "ORA-06502: PL/SQL: numeric or value error: character string buffer too small" and I managed to get around it by setting oParam.Size to length of command text instead of the parameter itself!?!

The stored proc signature is
<br />
CREATE OR REPLACE PROCEDURE spXXXXX (<br />
TestId varchar2,<br />
bAllTestCleared OUT varchar2<br />
)<br />
...


And my code/C# - yes first place I checked is that I have set parameter size of course:
<br />
void SomeTest()<br />
{<br />
IDbConnection oConn = null;<br />
IDbCommand oCmd = null;<br />
IDataParameter oParam = null;<br />
IDataParameter oOutParam = null;<br />
<br />
string strTestId = null;<br />
<br />
object oReturnValRaw = null;<br />
<br />
try<br />
{<br />
strTestId = Guid.NewGuid().ToString();<br />
...<br />
oConn = DBUtil.GetDefaultDBConnection();<br />
oConn.Open();<br />
<br />
oCmd = oConn.CreateCommand();<br />
oCmd.CommandText = "spXXXXX";<br />
oCmd.CommandType = System.Data.CommandType.StoredProcedure;<br />
<br />
oParam = oCmd.CreateParameter();<br />
oParam.Value = strTestId;<br />
oParam.ParameterName = ":TestId";<br />
oParam.DbType = DbType.String;<br />
((OracleParameter) oParam).Size = strTestId.Length; // Also tried doubling size - Size = Size *2. Actually, I solved the problem by setting - oParam.Size = oCmd.CommandText.Length - what the hell...? It worked, but I have no idea why!?<br />
oParam.Direction = ParameterDirection.Input;<br />
oCmd.Parameters.Add(oParam);<br />
<br />
oOutParam = oCmd.CreateParameter();<br />
oOutParam.ParameterName = ":bAllTestCleared";<br />
oOutParam.DbType = DbType.String; // one character string, either: 'Y' or 'N'<br />
((OracleParameter) oOutParam).Size = 1;  // Also tried doubling size - Size = Size *2<br />
oOutParam.Direction = ParameterDirection.Output;<br />
oCmd.Parameters.Add(oOutParam);<br />
<br />
oCmd.ExecuteNonQuery();<br />
<br />
oReturnValRaw = oOutParam.Value;<br />
...<br />
}<br />
catch (Exception ex)<br />
{<br />
...<br />
} finally {...}<br />
}<br />

Any suggestion? Is this a bug?
http://forums.oracle.com/forums/thread.jspa?messageID=3258848

Thanks

dev

modified on Monday, June 29, 2009 2:47 AM

QuestionNeed feedback on new Silverlight series Pin
ProtoBytes28-Jun-09 16:45
ProtoBytes28-Jun-09 16:45 
Question[Message Deleted] Pin
JollyMansArt28-Jun-09 14:58
JollyMansArt28-Jun-09 14:58 
AnswerRe: what is wrong? Pin
Luc Pattyn28-Jun-09 15:19
sitebuilderLuc Pattyn28-Jun-09 15:19 
AnswerRe: [Message Deleted] Pin
Luc Pattyn28-Jun-09 16:07
sitebuilderLuc Pattyn28-Jun-09 16:07 
Question64 bit windows Pin
devvvy28-Jun-09 13:19
devvvy28-Jun-09 13:19 
AnswerRe: 64 bit windows Pin
Christian Graus28-Jun-09 13:32
protectorChristian Graus28-Jun-09 13:32 
Questionabout application domain Pin
Seraph_summer28-Jun-09 9:11
Seraph_summer28-Jun-09 9:11 
AnswerRe: about application domain Pin
Manas Bhardwaj28-Jun-09 9:16
professionalManas Bhardwaj28-Jun-09 9:16 
GeneralRe: about application domain Pin
Seraph_summer28-Jun-09 9:41
Seraph_summer28-Jun-09 9:41 
GeneralRe: about application domain Pin
Pete O'Hanlon28-Jun-09 11:20
mvePete O'Hanlon28-Jun-09 11:20 
GeneralRe: about application domain Pin
N a v a n e e t h28-Jun-09 16:13
N a v a n e e t h28-Jun-09 16:13 
Questionnested string Pin
Seraph_summer28-Jun-09 9:08
Seraph_summer28-Jun-09 9:08 
AnswerRe: nested string Pin
harold aptroot28-Jun-09 9:14
harold aptroot28-Jun-09 9:14 
AnswerRe: nested string Pin
padmanabhan N28-Jun-09 18:59
padmanabhan N28-Jun-09 18:59 
AnswerRe: nested string Pin
Henry Minute28-Jun-09 22:56
Henry Minute28-Jun-09 22:56 
QuestionSystem.AccessViolationException: Attempted to read or write protected memory. Pin
Revathij28-Jun-09 0:29
Revathij28-Jun-09 0:29 
QuestionDeserialization Issue Pin
al3xutzu0027-Jun-09 23:28
al3xutzu0027-Jun-09 23:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.