List Info

Thread: C-Sharp (C#) Group: Dear expert:




C-Sharp (C#) Group: Dear expert:
user name
2006-02-16 03:20:56
Dear expert:

I have problem with the OleDbType, I stored Chinese data
value in
DataBase and use DataReader to retrieve it to local(say, in
interface):

  OBJECT_SETTING1 = dbRdr.GetValue(17).ToString(); //
Chinese text

 then I save it to DataBase by some storedprocedure by
assigning it to
some certain parameter:

  myNewParameter =
runSP.Parameters.Add("V_objval",OleDbType.VarCha
r,OBJECT_SETTING1.Length+10);
//
  myNewParameter.Value = OBJECT_SETTING1;


 while I run the runSP (SQLcommand) from C#, it pops up the
error
message:

 ORA-01460: cannot convert or conversion is unacceptable.

Could someone can help me to give some solution?

Thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---

C-Sharp (C#) Group: Re: Dear expert:
user name
2006-02-16 04:38:34
By the way, if it's English, then it's ok, the
runtime/compiling
environment is:
windowsXP(CharacterSet: Chinese),Oracle10g(CharacterSet:
Simplified
Chinese)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---

C-Sharp (C#) Group: Re: Dear expert:
user name
2006-02-16 06:05:46
Here I give an simple example:

			DBCONN.DBCONNECT newcon = new DBCONN.DBCONNECT();
			System.Data.OleDb.OleDbCommand olecmd = new
System.Data.OleDb.OleDbCommand("P_TST");
			olecmd.Connection =DBCONN.DBCONNECT.connection;
			System.Data.OleDb.OleDbDataReader newrdr = null;
			System.Data.OleDb.OleDbParameter newprm = new
System.Data.OleDb.OleDbParameter();
//olecmd.Parameters.Add("V_CHN",System.Data.OleD
b.OleDbType.VarWChar,6);
			newprm.ParameterName = "V_CHN";
			newprm.DbType = DbType.String;
			newprm.Value = "测试";
			olecmd.Parameters.Add(newprm);
			olecmd.CommandType =
System.Data.CommandType.StoredProcedure;
			newprm.Direction = System.Data.ParameterDirection.Input;
			try
			{
				olecmd.ExecuteNonQuery();
			}
			catch(Exception E)
			{
				DBCONN.DBCONNECT.errProcess(E,-1," ");
			}


the storedprocedure is:

CREATE OR REPLACE PROCEDURE P_TST(V_CHN IN VARCHAR2) AS
BEGIN
	DBMS_OUTPUT.PUT_LINE(V_CHN);
END;
/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )