From: Wilhelmina M. <w.m...@ve...> - 2003-12-30 20:05:38
|
Hello, =20 I am trying to convert some C# code the uses MSDE database with Firebird database. When I execute the following code: =20 private DataSet m_patientListDS =3D new DataSet("PatientList"); private FbDataAdapter m_patientAdapter =3D new FbDataAdapter(); =20 m_patientAdapter.TableMappings.Add("Table", "RS_PatientLevel"); FbCommand patientCommand =3D new FbCommand(SELECT_FROM_PatientLevel(), OpenConnection()); patientCommand.CommandType =3D CommandType.Text; m_patientAdapter.SelectCommand =3D patientCommand; m_patientAdapter.Fill(m_patientListDS); =20 I catch the following exception when the fifth line is executed: =20 Message: "Command must have a valid Transaction." _COMPlusExceptionCode: -532459699 HResult: -2146233079 =20 Note that the FbComand parameters SELECT_FROM_PatientLevel() is simply a function that returns the string to select the rows of an entire table = and OpenConnection() returns an open FbConnection. =20 These lines of code fails at the initialization step when the table is = empty and no rows are returned. When I run the same code using MSDE under the same conditions, I get no error. =20 Does anyone have any idea what I am doing wrong? =20 Mimi Maloles=20 =20 |