Hey guys I'm trying to do something really simple.. I'm checking a data column in my datarow if it's > 0 I want the item back color in the datalist to be green if its < 0 remain transparent...
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{
DataRowView drv = (DataRowVie...
I have a similar question of how to check if you are in a transaction. Instead of checking how do i allow nested transactions?
I am using Microsoft SQL File Database with ADO.NET. I seen examples using tsql and examples starting transactions using begin and using transaction names. When calling connection.BeginTransaction i call another...
Hi,
I am trying to obtain the stored procedure metadata (procedure name,parameter types,parameter names etc) for a procedure declared within an Oracle package, using the standard ADO.NET API - DbConnection.GetSchema call. I am using the ODP driver.
I see that the Package is listed in the 'Packages' and 'PackageBodies' metadata collecti...
I have a several DBF files generated by a third party that I need to be able to query. I am having trouble because all of the column types have been defined as characters, but the data within some of these fields actually contain binary data. If I try to read these fields using an OleDbDataReader as anything other than a string or chara...
Hi all I am doing something like this -
void update(ClasstoUpdate obj)//obj is already having values to update...
{
var data= (from i in Entityobject.ClasstoUpdate
where obj.Id==i.Id
select i).FirstorDefault();
data.Name="SomeCoolName";
EntityObject.SaveChanges();
}
I want to perform an update without a...
I have a c# library project, that i configured using nhibernate, and I like people to be able to import this project and use the project. This project has FrontController that does all the work.
I have a connection string in hibernate config file and in app.config file of another project.
it would be nice for anyone to be able to set t...
I use SPs and this isn't an SP vs code-behind "Build your SQL command" question. I'm looking for a high-throughput method for a backend app that handles many small transactions. I use SQLDataReader for most of the returns since forward only works in most cases for me.
I've seen it done many ways, and used most of them myself.
Methods ...
I have a list of objects, this list contains about 4 million objects. there is a stored proc that takes objects attributes as params , make some lookups and insert them into tables.
what s the most efficient way to insert this 4 million objects to db?
How i do :
-- connect to sql - SQLConnection ...
foreach(var item in listofobjects)...
Can EF really be this bad? Maybe...
Let's say I have a fully loaded, disconnected object graph that looks like this:
myReport =
{Report}
{ReportEdit {User: "JohnDoe"}}
{ReportEdit {User: "JohnDoe"}}
Basically a report with 2 edits that were done by the same user.
And then I do this:
EntityContext.Attach(myReport);
InvalidOpera...
Hello,
If there an easy way to get a completed SQL statement back after parameter substitution? I.e., I want to keep a logfile of all the SQL this program runs.
Or if I want to do this, will I just want to get rid of Parameters, and do the whole query the old school way, in one big string?
Simple Example: I want to capture the outp...
Answer not needed - my logic was wrong and this question is invalid. Charles helped me see where I went off-tracks. Thanks
I have a utility that moves data from one source to another. In the process of writing the record I check to see if it exists and do an update/insert as necessary. The difficulty I have is that as I'm writing th...
Introduction
A user reported to me this morning that he was having an issue with inconsistent results (namely, column values sometimes coming out null when they should not be) of some parallel execution code that we provide as part of an internal framework. This code has worked fine in the past and has not been tampered with lately, bu...
We have a .NET 3.5 Web Service (not WCF) running under IIS. It must use identity impersonate="true" and Integrated Windows authentication in order to authenticate to third-party software. In addition, it connects to a SQL Server database using ADO.NET and SQL Server Authentication (specifying a fixed User ID and Password in the connectio...
While coding with sqlite everytime i always had the exact number of parameters and when i executed the query i always had 0 parameters after it. I kept using the cmd object and it worked fine.
Now while porting to use sql server (2008) my SqlConnection has parameters left over from a successful command. Why? I seem to be able to create ...
Hi
I am using ms sql server 2005 and I want to do a mass update. I am thinking that I might be able to do it with sending an xml document to a stored procedure.
So I seen many examples on how to do it for insert
CREATE PROCEDURE [dbo].[spTEST_InsertXMLTEST_TEST](@UpdatedProdData XML)
AS
INSERT INTO
dbo.UserTable(CreateDate)...
I am work on VB.net 2003 Framework 1.1 for last 3.5 years in windows Application.
We are currently migrating to VB.net 2008 framework 3.5, but i don't know about the features
which related to ADO.net and which is important to performance. I know linq to SQL but our architecture is made in .net 2003 so we should follow this.
Any features...
Assuming daily certain up to date database is produced via loading from various sources.
Changes need to be applied to historical database based on uid, new records will added , non existing will be softly deleted , some will be updated. Is Ado.Net and Sql statements the most appropriate technology for the task like this ?
...
I am grabbing the last rowid and i am doing this select @@IDENTITY
pk = (long)cmd.ExecuteScalar();
I get an invalid typecast bc this is int instead of long. Why doesnt this return a long? can i make it return long?
Solution for now is to use
pk = Convert.ToInt64(cmd.ExecuteScalar());
...
What does it mean for an SqlConnection to be "enlisted" in a transaction? Does it simply mean that commands I execute on the connection will participate in the transaction?
If so, under what circumstances is an SqlConnection automatically enlisted in an ambient TransactionScope Transaction?
See questions in code comments. My guess to...
I'm writing a test to see if my LINQ to Entity statement works.. I'll be using this for others if I can get this concept going..
my intention here is to INSERT a record with ADO, then verify it can be queried with LINQ, and then ROLLBACK the whole thing at the end.
I'm using ADO to insert because I don't want to use the object or the e...