Probem: No size set for variable length data type: String, using OracleDataAdapter

  • Thread starter Thread starter Benny
  • Start date Start date
B

Benny

Hi all,

Anyone face this problem on oracle 10g and Visual Studio.Net 2003 ?
The following code works fine if using the mysql4.1 with the library of the
MySQL.Data. But error occured while using the library of
System.Data.OracleClient :-

Error message:- 'p5': No size set for variable length data type: String.

Dim da As New OracleDataAdapter("SELECT * FROM member_grade_log WHERE logid
= " & (logid + 1).ToString(), RegConn)

da.Fill(ds, "member_log")

Dim dr As DataRow = ds.Tables("member_grade_log").NewRow

dr("logid") = logid
dr("edate") = Today().Date

dr("edatetime") = Now()

dr("event") = "SET"

dr("event_description") = txtDescription.Text

dr("member_id") = lblMember_id.Text

dr("pin_no") = lblPIN_no.Text

dr("member_name") = lblMember_name.Text

ds.Tables("member_grade_log").Rows.Add(dr)

da.Update(ds.Tables("member_grade_log")) [failed here ]



Thanks in advance.

regards,

Benny
 
¤ Hi all,
¤
¤ Anyone face this problem on oracle 10g and Visual Studio.Net 2003 ?
¤ The following code works fine if using the mysql4.1 with the library of the
¤ MySQL.Data. But error occured while using the library of
¤ System.Data.OracleClient :-
¤
¤ Error message:- 'p5': No size set for variable length data type: String.
¤
¤ Dim da As New OracleDataAdapter("SELECT * FROM member_grade_log WHERE logid
¤ = " & (logid + 1).ToString(), RegConn)
¤
¤ da.Fill(ds, "member_log")
¤
¤ Dim dr As DataRow = ds.Tables("member_grade_log").NewRow
¤
¤ dr("logid") = logid
¤ dr("edate") = Today().Date
¤
¤ dr("edatetime") = Now()
¤
¤ dr("event") = "SET"
¤
¤ dr("event_description") = txtDescription.Text
¤
¤ dr("member_id") = lblMember_id.Text
¤
¤ dr("pin_no") = lblPIN_no.Text
¤
¤ dr("member_name") = lblMember_name.Text
¤
¤ ds.Tables("member_grade_log").Rows.Add(dr)
¤
¤ da.Update(ds.Tables("member_grade_log")) [failed here ]
¤

Do any of your VarChar columns have an empty string?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Hi Paul,

Before answer your question, sorry for the missing line on the -
Dim cb As New OracleCommandBuilder(da) before the da.Fill(ds, "member_log").
Yeah, paul i am inserting the empty string on the parameter
dr("event_description"), which belongs to type varchar. There wasn't an
error while i am using mysql by inserting empty string but not until i
migrate to oracle using the System.Data.OracleClient.
Any alternative to solve this inserting empty string problem other
than I insert value of null e.g. DbValue.Null ? as this method going to need
a lot of checking e.g. checking the txtDescription.Text is null or not [it
is just optional field] on my site.. Can OracleCommandBuilder insert the
empty string directly to parameter type varchar ?
Thanks in advance.

regards,

Benny
 
¤ Hi Paul,
¤
¤ Before answer your question, sorry for the missing line on the -
¤ Dim cb As New OracleCommandBuilder(da) before the da.Fill(ds, "member_log").
¤ Yeah, paul i am inserting the empty string on the parameter
¤ dr("event_description"), which belongs to type varchar. There wasn't an
¤ error while i am using mysql by inserting empty string but not until i
¤ migrate to oracle using the System.Data.OracleClient.
¤ Any alternative to solve this inserting empty string problem other
¤ than I insert value of null e.g. DbValue.Null ? as this method going to need
¤ a lot of checking e.g. checking the txtDescription.Text is null or not [it
¤ is just optional field] on my site.. Can OracleCommandBuilder insert the
¤ empty string directly to parameter type varchar ?
¤ Thanks in advance.

Using a Command should work fine as long as your column doesn't require data. Otherwise, if you're
updating from the Dataset you will probably need to use DbValue.Null.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Hi,

Thanks paul for your advice, I know using the command would solve the
problem but my concern come back again -> I need to do a lot of work. I need
CommandBuilder to fasten my development here.
Hence, I shifted to use the oracle data provider already, and it doesn't
aspect me to do the changes to solve the empty string issue here.
Thanks a lot by the way !

regards,

Benny
 
Back
Top