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...
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...
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...
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...
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 ...
are you know the difference between this two condition
1
if(reader.hasrows())
{
while(reader.read())
{
}
}
2
while(reader.read())
{
if(reader.hasrows())
{
}
}
...
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...
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...
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...
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...
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 ...
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
...