Все вопросы: [ado.net]

880 вопросов

похожие теги: ado.net-entity-data-model
4
голосов
6ответов
6582 просмотров

Entity Framework v2 doesn't support sql 2000?

I installed the beta 2 of Visual Studio 2010 today. I went to test out the new entity framework stuff (to see if my "issues" from v1 were fixed.). I started adding a new connection string, but when i put in my information for sql 2000 it said "this server version is not supported. you must have...

0
голосов
1ответов
502 просмотров

Ado Entity Framework Adding Data

I'm having a little trouble with my Entity add functionality. Setup For simplicity, I have in DB with 4 tables, Customer, Address, Area, Location. Customer stores basic customer details ie. Id, Name, Username, Password, etc. Address stores street name, street number, etc. Area stores area nam...

2
голосов
2ответов
4668 просмотров

Using SMO, still no go... ConnectionContext.ExecuteNonQuery(script) can't understand "GO"

SQL Server 2008 Using all the correct references I dare say: System.Data.SqlClient; Microsoft.SqlServer.Management.Smo; Microsoft.SqlServer.Management.Common; Microsoft.SqlServer.Management.Sdk.Sfc; All compiles with no errors. I have stripped code down to almost zero for easy debugging. Co...

0
голосов
4ответов
2160 просмотров

what's wrong with this ADODB connection string to sql server 2005

I'm working on populating a combobox in visual studio 2005 using vb and I'm stuck on the connection string part. I should mention i'm connecting to a SQL Server 2005 instance. Here is what i have: Dim gDBA As ADODB.Connection Dim records As ADODB.Recordset gDBA = New ADODB.Connection gDBA.O...

0
голосов
1ответов
2280 просмотров

ADO.NET DataRelations and many-to-many relationship

I was really drawn in and fascinated by the DataRelation object for use in an ADO.NET DataSet to cache data from my database in an ASP.NET web application. Unfortunately, I realized quite late, that I really have three DataTables. Users with a PK of UserID Groups with a PK of GroupID UsersInGr...

3
голосов
2ответов
1885 просмотров

Informing the user that a DataGridView is being populated

I am writing a program in VB.Net to manage text messages sent through an API. It allows you to view messages in a datagridview and filter by date, sent/unsent etc... To load the messages I'm executing an SQL statement and retrieving a DataTable which then gets set as the DataSource for my DataGr...

4
голосов
6ответов
1677 просмотров

Disposing the Sql Connection

Just wondering, Would the SqlConnection be diposed/closed when this method is done? Or do i have to explicitly call the close method at the end? using (SqlCommand cmd = new SqlCommand(sql, GetConnection())) { SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) ...

2
голосов
2ответов
4059 просмотров

SQL Server communication protocol issue

I am using VSTS 2008 + C# + ADO.Net + SQL Server 2008. My questions about what kinds of communication protocols SQL Server 2008 will be using, more details of my questions, If the connection string looks like this, whether Named Pipe or TCP/IP is used? Will different communication protocol bei...

0
голосов
1ответов
220 просмотров

Coding approach/pattern to use DataSet as domain objects for a small application?

Assumption - For a simple app I have with only a few tables & I plan to stay simple and use DataSet for my data access as well as domain layer. In other way, in this small application, I won't create separate classes but rather just use the DataSet directly. Question - Does anyone have any...

0
голосов
2ответов
2687 просмотров

DataTable.AsEnumerable().Distinct() doesn't work because of primary key column

I want to remove duplicates from my DataTable so I'm using DataTable.AsEnumerable().Distinct(DataRowComparer.Default) but it doesn't do what I need. I think because each duplicate row has it's unique primary key column. How can I do what I need? Write my own DataRowComparer? I don't want - becau...

0
голосов
1ответов
858 просмотров

How to get schema of our table without filling its DataTable before calling NewRow method?

I know that I should have schema of a table before calling NewRow method in order to add a new row to a DataTable.... But as you know, having the schema of a table means filling its DataTable by records from DB. This means connecting to DB and fetch records. Is there any way to have schema with...

4
голосов
2ответов
5010 просмотров

How do I retrieve DataColumn.DefaultValue from a Sql Table?

Is there a way to determine a column's defaultvalue from the Sql Database using ado.net? I tried using the SqlDataAdapter's FillSchema method: using (SqlDataAdapter adapter = new SqlDataAdapter()) { adapter.SelectCommand = myConnection.CreateCommand(); adapter.SelectCommand.CommandType...

1
голосов
2ответов
507 просмотров

ADO.NET (Sql Compact + MySQL + IBM db2 expressC)

I'm developing an app which will have a central database users can add entries to. The database will have to be on a server somewhere but I want the users to be able to add entries offline. The app will sync to the main db when connection is available. So, I supose I need 2 databases - the main o...

1
голосов
6ответов
1955 просмотров

what to check for when a datareader might not have a particular column?

I am doing a null check but I am getting a index of out range exception when doing: if(myReader["column1"] != null) { } Under certain conditions that column will not be present, why isn't a null check working?

2
голосов
2ответов
836 просмотров

Does ADO.NET Entity Framework have a construct similar to LINQ to SQL's GetTable<t>?</t>

Does ADO.NET Entity Framework have a construct similar to LINQ to SQL's GetTable? I'm trying to do something similar in Entity Framework, that I'm very used to doing in LINQ to SQL. Does ADO.NET Entity Framework have the same capability? LINQ to SQL: dataContext.GetTable&lt;T&gt;(); It would...

4
голосов
4ответов
8726 просмотров

Entity Framework ObjectContext -&gt; raw SQL calls to native DBMS

I have an app using the ADO.NET entity framework (the VS2008 version, not the newer, cooler one) and I need to be able to make a call down to the underlying DBMS (it's postgres) in order to call some SQL that Entity Framework doesn't support. Is there a way to go from an Entity Framework Object...

12
голосов
6ответов
19035 просмотров

Convert DataColumn.DataType to SqlDbType

Is there a converter for going from DataColumn.DataType to SqlDbType? Or do I have to write a method to do it?

1
голосов
2ответов
1751 просмотров

Need recordset behavior in VB.NET w/ADO help

VB.NET newbie here. I've learned (through this site) how to negotiate a dataset via: For Each dRow In quanDS.Tables(0).Rows 'do something to each row Next I now need to figure out now to loop through a subset of the records returned in the dataset - here's a VB6 example I need to convert: ...

0
голосов
5ответов
477 просмотров

List<t> fill collection performance</t>

I am having performance problem when truing to fill typed list. Below is my simplified code: public static List&lt;Product&gt; GetProducts() { List&lt;Product&gt; products = new List&lt;Product&gt;(); using (DbQuery query = new DbQuery()) //this is...

0
голосов
5ответов
1873 просмотров

Is there a standard dialog for constructing an ADO.Net connection string (that is redistributable)?

I want to use a standard dialog to solicit user input of an ADO.net connection string. It is trivial to do for the oledb connection string as described here: MSDN Article on MSDASC.DataLinks().Prompt I've also found examples that use Microsoft.Data.ConnectionUI.dll and MicrosoftData.ConnectionU...

0
голосов
1ответов
146 просмотров

Are .NET automatic data forms a good idea?

I'm a Linux guy usually, but at the moment I'm trying to evaluate .NET for a Windows desktop application. All it needs to do is to display some forms that link to a database, let the user edit the data and then produce reports based on it. I found a walkthough at http://msdn.microsoft.com/en-us/l...

3
голосов
7ответов
247 просмотров

How to create a proper database layer?

Currently I use a lot of the ado.net classes (SqlConnection, SqlCommand, SqlDataAdapter etc..) to make calls to our sql server. Is that a bad idea? I mean it works. However I see many articles that use an ORM, nHibernate, subsonic etc.. to connect to SQL. Why are those better? I am just trying to...

0
голосов
1ответов
563 просмотров

Atomicity of Data Adapter in ADO.NET

I am new to ADO.NET and learning it. I was wondering if Data Adapter in ADO.NET provides atomicity or ACID properties by itself when filling the Data Set and updating the Database, or do we have to use transaction explicitly to achieve this. Let's say: I want to fetch data from the Database th...

0
голосов
1ответов
325 просмотров

Ado.net entity data model doesn't exist

I've intalled vs2008 ts on my windows 7 x64 pc, but when I tried to add ado.net entity data model there is no template for it. All the MSDN tutorials say that vs2008 has it.

2
голосов
2ответов
9694 просмотров

How do you change specific data in a datatable column?

I've populated a DataTable with a DataAdapter but I would like to change the values dynamically for all of the rows in that column in the DataTable. How do I go about doing this? Here is my current code: SqlConnection conn = null; string sSQL = ""; string connString = "Datasourceetc"; sSQL = ...

0
голосов
1ответов
219 просмотров

ADO.net - what are the constraints on database connectivity for use of DataSet and DataAdapter?

Re ADO.net, I get the concept generally of DataSet and DataAdapter. What's not clear if I may ask is: Q1 - What constraints are there on whether the database connection need to remain open or not? Can I close the connection but still work with DataSet? If so what needs to be in place to perf...

2
голосов
2ответов
271 просмотров

In what situations is the prepare method of a SqlCommand object useful?

Does any body know that in what situations the prepare method of an ADO.NET SqlCommand Object is useful?

4
голосов
1ответов
2501 просмотров

How expensive is SqlCommandBuilder.DeriveParameters?

What is the cost of calling SqlCommandBuilder.DeriveParameters? I understand that a round-trip is required to the DB server to get the parameters. After this is called, will the information be cached by the provider, or will it be re-queried EVERY time this method is called?

1
голосов
5ответов
266 просмотров

How to talk to a database in a portable way?

I'd like to start an application that makes heavy use of a database, and is supposed to run on Windows under .NET as well as Mac/Linux under Mono. Having done some research, I've realised that neither LINQ-to-SQL nor LINQ-to-Entities are production-ready in Mono at the moment (here and here). Ac...

1
голосов
1ответов
1850 просмотров

sqlite ado.net provider - which is the most popular to use? (e.g. phxsoftware, devart, mindscape)

Regarding starting to use SQLite within C# Visual Studio 2008 for a winforms application, it seems from the sqlite site you have to download a sqlite ado.net provider, and there are numerous listed (in .net section of sqlite wrappers) QUESTION - Which is the most popular/robust sqlite wrapper th...