Hi,
How do I get all rows from ITEM table, which are children of a parent ITEM table row, where relationship is stored separately? How can I do a join to do this? "get all rows from ITEM table, which are children of this specific ITEM table row, all child items from this parent item, where relationship is stored in separate RELATIONSH...
I'm working on a project that uses ADO.NET entity framework as the ORM framework for getting data in and out the database. This all works great, but there's one association that I don't want to map. At least I don't want the developers to navigate from Product to OrderItem using the association between them.
Has anyone tried this scenar...
What is the time complexity of accessing a column by its name in an instance of DataRow?
object Foo(DataRow row, string columnName)
{
// What is the time complexity of the below line O(1) / O(n) / ?
return row[columnName];
}
...
I am trying to execute DBCC CHECK DB('MyDB) using ADO.Net, but how can I get the text returned by the command?
I have tried the following:
SqlCommand sqlCom = new SqlCommand("DBCC CHECKDB ('MyDB')", sqlCon);
SqlParameter output = new SqlParameter();
output.Direction = System.Data.ParameterDirection.ReturnValue;
sqlCom.Parameters.Add(ou...
Hi
What is the best way to implement a TransactionScope in a OpenSessionInView type pattern in a ASP.NET website?
In the OpenSessionInView pattern a Http Module starts and closes a SqlTransaction, so that a single Transaction is used for the whole request rather than multiple Transactions.
I would like to extend it to manage connectio...
I am trying to use MySQL 5 with C#. I downloaded MySQL driver on mysql.com and installed it. I can now connect to MySQL in C# with the following code.
string ConString = "SERVER=192.168.10.104;";
ConString += "DATABASE=test;";
ConString += "UID=user;";
ConString += "PASSWORD=password;";
MySqlConnection connection = ...
I'm trying to learn some C#.net. I'm just trying to expose the AdventureWorks database included in my C# class via a web interface. Here's the setup:
I've got a DropDownList in on my ASPX page with an id of tableNameDropDown. It gets populated on Page_Load like this:
protected void Page_Load(object sender, EventArgs e)
{
...
I have the following code:
var entityConnection = (System.Data.EntityClient.EntityConnection)c.Connection;
DbConnection conn = entityConnection.StoreConnection;
ConnectionState initialState = conn.State;
List<Jobs> list = new List<Jobs>();
int id = 0;
try
{
if (initialState ...
[I am new to ADO.NET and the Entity Framework, so forgive me if this questions seems odd.]
In my WPF application a user can switch between different databases at run time. When they do this I want to be able to do a quick check that the database is still available. What I have easily available is the ObjectContext. The test I am prefo...
For example, I have a table, and there is a column named 'Tags'. I want to know if value 'programming' exists in this column. How can I do this in ADO.NET?
I did this: OleDbCommand cmd = new OleDbCommand("SELECT * FROM table1 WHERE Tags='programming'", conn);
OleDbDataReader = cmd.ExecuteReader();
What should I do next?
...
I currently have a .NET solution I'm developing that involves several sub-projects, including an ASP.NET MVC project. My model has been separated into a separate assembly because I need to use it from the various other projects in the solution.
My model consists of an ADO.NET Entity Framework entity model. I have decided to go with a si...
I am trying to write REST web service through which our clients can upload a file on our file server. IS there an example or any useful links which I can refer for any guidance?
I haven't seen many examples of POST operation using ADO.NET data services available.
...
Hi,
The problem that i'm having is how can i synchronise my datasets in my VS 2008 project to any changes in the database.
As you know we read data from the db into the dataset which is disconnected, now lets say 1 minute later something updates the data in the database. What i want to do is after a set time interval check the db for...
I have an application which would read data from SQL and send it via WCF to a client app, in a manner similar to this:
SqlDataAdapter da = new SqlDataAdapter( cmd )
DataSet ds = new DataSet();
da.Fill( ds );
return ds;
All the date/times are stored in the database as UTC. What I noticed is that if clock on computer running the applica...
This is my example code:
var klienciToAdd = new klienci();
klienciToAdd.nazwa = collection["nazwa"];
klienciToAdd.miejscowosc = collection["miejscowosc"];
_db.AddToklienci(klienciToAdd);
_db.SaveChanges();
...
I've created many-to-many relationship with ADO.NET with extra order fields in the middle table.
So I have...
Customers
-customer_id
-customer_name
Orders
-order_id
Customers_to_Orders
-customer_id
-order_id
-seq
And now I don't really know how to add new orders to customers with specyfing order, any suggestions?
...
My database tables are as follows:
Users (UserId, Name)
Friends (UserIdFrom, UserIdTo)
I also have an ADO .NET entity data model that describes these tables.
My .NET entity data model has an entity named Users and an association for that entity called Friends that corresponds to the Friends table.
My question is that I want to get a ...
I am very new to LINQ and have a class method, which when called, returns a DbDataReader object. How would I sort this dynamically using a LINQ query expression where the sort expression is provided as a string (e.g. "LastName DESC")
...
We are running an asp.net web application which uses ado.net to connect to the database. I'd like to monitor the ado.net performance counters. Right now im using Control Panel -> Performance to do so. But the instance names seem to change when the Application is restarted. So the logging no longer logs the counters. What is the best way ...
I'm looking for a way to continue execution of a transaction despite errors while inserting low-priority data. It seems like real nested transaction could be a solution, but they aren't supported by SQL Server 2005/2008. Another solution would be to have logic to decide if an error is critical or not, but it would seem that's not possibl...