If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > handling the text datatype from asp.net

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-17-04, 15:02
vishalg_99 vishalg_99 is offline
Registered User
 
Join Date: Mar 2004
Posts: 2
Question handling the text datatype from asp.net

Hi,

We are building a web application using asp.net. We are using the informix odbc driver version 3.81. Informix database version 7.3.2.
We have created a stored procedure to insert data into a table. The table has a field of "text" datatype.
I am unable to insert data into this field. It seems, Problem has to do with resolving the datatype.

For those familiar with .NET, following is the syntax i am using to describe the field in the stored procedure call that i am making:

Dim textcol As OdbcParameter = New OdbcParameter("",OdbcType.Text)
textcol.Value = "dummy text"
OdbcCommand.Parameters.Add(textcol)

OdbcType.Text is supposed to match up with the informix Text datatype, but there seems to be a problem.

Any help would be greatly appreciated!

Thank you in advance.
Reply With Quote
  #2 (permalink)  
Old 03-22-04, 04:56
DoktorBlue DoktorBlue is offline
Registered User
 
Join Date: Aug 2003
Location: Delft, The Netherlands (EU)
Posts: 447
Re: handling the text datatype from asp.net

Don't you have an OdbcType.Char, too?
__________________
Make everything as simple as possible, but not simpler! - A. Einstein
DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool
Reply With Quote
  #3 (permalink)  
Old 03-23-04, 12:12
vishalg_99 vishalg_99 is offline
Registered User
 
Join Date: Mar 2004
Posts: 2
Re: handling the text datatype from asp.net

Yes there is but Odbc.Char doesn't match up with the Text datatype of Informix. I resolved the problem though. It seems that the problem is with the syntax used below:

Dim textcol As OdbcParameter = New OdbcParameter("",OdbcType.Text)
textcol.Value = "dummy text"
OdbcCommand.Parameters.Add(textcol)

if you rearrange it to:

myCommand.Parameters.Add(New OdbcParameter("", OdbcType.Text)).Value = Instructions

then it works. just an ODBC flaw i guess...

Thanks.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On