executereader

LinqToSQL and the exception " ExecuteReader requires an open and available Connection."

Hi guys, I have a collection called dbUsers of type IQueryable These are pulled from a linqtosql database context i.e. IQueryable<Data.LinqToSQL.User> dbUsers = DBContext.Users Calling ToList on this object: IList<Data.LinqToSQL.User> users = dbUsers.ToList(); Results in an exception: ExecuteReader requires an open and available...

SubSonic InlineQuery returning wrong results with ExecuteAsCollection

Using SubSonic 2.2, I have this query: string q = @"SELECT Media.Id, Media.Title FROM Media WHERE Media.UserId = 7" DAL.MediumCollection matches = new InlineQuery().ExecuteAsCollection<DAL.MediumCollection>(q).Load(); Looping through "matches" results in every single entry in the "Media" table. However, when I do this: IDataReader r...

executereader never return

i am using mysql via devart dotconnect. above code is part of the multithreaded class. public void DoQuery(ref Devart.Data.MySql.MySqlDataReader Dr, string QryStr) { lock (locker) { //Program.MyMutex.WaitOne(); Devart.Data.MySql.MySqlCommand Command = new Devart.Data.MySql....

List tables involved in a sql statement before it is run?

Is it possible, in .NET, to pass a sql statement to SQL server for parsing and return the tables involved in the statement and the type of operation. So for a statement like this : select * from Table1 left outer join Table2 on Table1.id=Table2.foreignid; delete from Table2 where date < 2009/12/12 SQL Server might return the tables in...

ExecuteReader with Oracle array binding

I'm trying to improve performance of my Oracle SQL queries by using array binding to an OracleParameter. This is basically what I'm trying to do: List<string> IDValList = new List<string>(); IDValList.Add( "IDOne" ); IDValList.Add( "IDTwo" ); List<int> sizes = new List<i...

Invalid attempt to call FieldCount when reader is closed

Hello guys/girls The error above occurs when I try to do a dataReader.Read on the data recieved from the database. I know there are two rows in there so it isnt because no data actually exists. Could it be the CommandBehavior.CloseConnection, causing the problem? I was told you had to do this right after a ExecuteReader? Is this correc...

packet of queries - MySQL

Hi, is there a way to send packet of queries in 1 query to mysql using c# ? i mean i got 13 selects, they are not related, so cant union them, they get diffrent type of data. Now i got dbconn, 13x select, dbclose, its not a problem when it works over lan, but over internet it sometimes takes to slow cos of latency (13x select and recive ...