executequery

LINQ-to-SQL: ExecuteQuery(Type, String) populates one field, but not the other

I've written an app that I use as an agent to query data from a database and automatically load it into my distributed web cache. I do this by specifying an sql query and a type in a configuration. The code that actually does the querying looks like this: List<Object> result = null; try { result = dc.ExecuteQuery(elementType, entry.Com...

linq2sql: using ExceuteQuery<dto> when rows returned are not in my dto? Can i use a generic data type?

hi there, been using ExecuteQuery with some success, i.e. where AccessRights is my dto and queryString contains "Exec sp_name param1,param2 etc" var accessRights = this.db.ExecuteQuery<AccessRights>(queryString, sqlParams.Values.ToArray()).AsQueryable(); Everything works perfect if what returns from the stored procedure can be...

Asynchronous data loading in Entity-Framework?

Did anyone hear about asynchronous executing of an EF query? I want my items control to be filled right when the form loads and the user should be able to view the list while the rest of the items are still being loaded. Maybe by auto-splitting the execution in bulks of items (i.e. few queries for each execution) all in same connection...

Exception on ExecuteNonQuery method about unsuccessful value convertion

i am using OleDbCommand.ExecuteNonQuery() to insert data into the database: ObjCommand = New OleDbCommand ObjCommand.CommandType = CommandType.StoredProcedure ObjCommand.CommandText = StrSQL ObjCommand.Parameters.Add("field1", OleDbType.VarChar).Value = <something1> ObjCommand.Parameters.Add("field", OleDbType.VarChar).Value = <somethi...

C# ExecuteQuery null value

I have some code: using (OAZISDBDataContext ctx = new OAZISDBDataContext()) { IEnumerable<DBContactDetail> details = ctx.ExecuteQuery<DBContactDetail>("exec [dbo].[zna_contact] {0}, {1}", "test", "19601023", } However I also want to be able to pass empty ...

what is diference in this two exection command in c#

are you know the difference between this two condition 1 if(reader.hasrows()) { while(reader.read()) { } } 2 while(reader.read()) { if(reader.hasrows()) { } } ...

Calling stored proc with LINQ .ExecuteQuery to return non-mapped fields

I have a stored procedure which returns all the fields of a table plus one, ie: tablename.*,count(suchandsuch) Of course, when executing this via LINQs ExecuteQuery I can get back instances of the table's class in an IEnumerable<>, but I also want the extra field which the stored proc tacks on. Is this possible? My current code look...

LINQ - Can ExecuteQuery return a DBML generated class without having it fetch all the information for that class?

I have a couple of DBML generated classes which are linked together by an id, e.g. ClassA { AID, XID, Name } ClassB { AID, ExtraInfo, ExtraInfo2 } In using something like db.ClassAs.Where(XID == x) and iterating through that result, it ends up executing a query for each of the ClassAs and each of ClassBs, which is slow. Alternat...

Is it possible to return multiple result sets using ExecuteQuery in Linq to Sql?

I know that you can return multiple results from a stored procedure and through the method generated by the designer. However, I'm trying to do the same using ExecuteQuery but it doesn't seem like it's possible. Has anyone tried or know whether this is possible? Basically I'm trying to run an ad-hoc stored procedure. By ad-hoc, I mean...

In maven, how can I execute a SQL if I detect the table structure is missing?

I'm modifying an existing maven2 project and I would like to create the database structure if I notice it is missing. I sort-of know how to do this in ant, I could query the database and if the table is missing I could execute the query. But, maven is a different thing. I found a SQL plugin to run the script, but I don't know where o...

executing a reference to field.onchange in Firefox

I have HTML code which calls a javascript function from a form, using: <form name="f" id="f" ...> <input name="myField" onchange="doFunct(f.myField.value,f.yourField);" /> <input name="yourfield" onchange="doFunct(f.yourField.value,f.anotherField);" /> ... In the javascript code: function doFunct(field,dest){ // do something ...

How to cast INT32 to INT during a SQL select through a LINQ data context?

Hi, I have the following statement: someList = dc.ExecuteQuery<MyCustomType>(@"Select Id As ProductId, Name From ivProduct").ToList(); Id in the database is stored as int32, when my Id property of MyCustomType is INT. Is there a way to cast that int32 to int during a select? Thank you ...