November 29, 2007 at 12:39 pm
hi,
I am trying to read a clob field of an oracle table through oledbcommand but it throws an exception saying "datatype is not supported".
I am using .NET 2.0 with VS2005 not sure about the oracle version of server
public void clob()
{
string strcommodity = null;
string connectionString = "PASSWORD=abc;PERSIST SECURITY INFO=TRUE;USER ID=abc;DATA SOURCE=abc;provider=MSDAORA;";
OleDbConnection OleDbCon = new OleDbConnection(connectionString);
OleDbCommand olecomm = new OleDbCommand("select clobcolumn from table1",OleDbCon);
OleDbCon.Open();
OleDbDataReader oleReader = olecomm.ExecuteReader();
while (oleReader.Read())
{
strcommodity = oleReader.GetString(0);
}
OleDbCon.Close();
oleReader.Close();
}
Any one has any idea if clob is not supported by oledb provider or i am making any mistake...?
pls provide ur input..
December 4, 2007 at 10:04 am
I don't understand why you need to use OLEDB instead of the Microsoft or Oracle providers both are free. I also noticed there is no memory stream in you code, I don't think you can use image in Asp.net pages without passing your image through memory stream. Look at the code sample in the link below using ODP.NET. Hope this helps.
http://www.oracle.com/technology/oramag/oracle/05-nov/o65odpnet.html
Kind regards,
Gift Peddie
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy