From: Tony R. <to...@so...> - 2004-01-23 12:05:18
|
I am having trouble with FbDatareader. It seems to be null (I think) after the ExecuteReader() stage. Platform ======== Windows XP Pro FirebirdNETProvider1.5-RC2-NET1.1 Firebird Server 1.5 RC7 Delphi 8 Enterprise Source Code =========== procedure TWinForm.btnTest_Click(sender: System.Object; e: System.EventArgs); var AList : ListItemCollection; sCon,sSQL : string; connection : FBConnection; transaction : FBTransaction; command : FBCommand; reader : FbDataReader; begin AList := ListItemCollection.Create; sCon := 'Database=localhost:C:\Data\OMS\OMSData.GDB;User=SYSDBA;Password=masterkey;D ialect=3;Server=localhost'; connection := FBConnection.Create(sCon); connection.Open; sSQL := 'SELECT * FROM USERS'; command := FBCommand.Create(sSQL,connection); reader := command.ExecuteReader(); while reader.read do begin AList.Add(ListItem.Create(reader['NAME'].ToString,reader['INITIALS'].ToStrin g)); end; reader.close; connection.Close; ListBox1.DataSource := AList; end; Source Code (Reflected back into C#) ==================================== private void btnTest_Click(object sender, EventArgs e) { FbDataReader reader1; ListItemCollection collection1; FbConnection connection1; FbCommand command1; string text1; string text2; FbTransaction transaction1; collection1 = new ListItemCollection(); text1 = "Database=localhost:C:\Data\OMS\OMSData.GDB;User=SYSDBA;Password=masterkey;D ialect=3;Server=localhost"; connection1 = new FbConnection(text1); connection1.Open(); text2 = "SELECT * FROM USERS"; command1 = new FbCommand(text2, connection1); reader1 = command1.ExecuteReader(); while (reader1.Read()) { collection1.Add(new ListItem(reader1["NAME"].ToString(), reader1["INITIALS"].ToString())); } reader1.Close(); connection1.Close(); this.ListBox1.DataSource = collection1; } Error Generated at line reader := command.ExecuteReader(); ============================================================ Errors: FbErrorCollection& ErrorCode: 335544569 Message: "Dynamic SQL Error SQL error code = -901 Feature is not supported" InnerException: GdsException& TargetSite: RuntimeMethodInfo& StackTrace: " at FirebirdSql.Data.Firebird.FbCommand.ExecuteReader(CommandBehavior behavior) ...etc HelpLink: "null" Source: "FirebirdSql.Data.Firebird" Hresult: -2146233087 |