Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!


Archived Months
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
August 2008


all groups > dotnet ado.net > march 2008

Filter by week: 1 2 3 4 5

Update not working
Posted by Neil B at 3/31/2008 11:06:07 AM
I'm developing a Web App in C#. The following method executes without exceptions but the database does not get changed. The data is changed in the record[0] at the point prior to executing the " adapter.Update(record);" instruction. Is there something else I should be doing to insure the...more >>

Data is different than in database
Posted by fniles at 3/28/2008 11:28:54 AM
I am using MS Access and VB .NET 2005 (the same problem happens in VB.NET 2008). I am reading from a query using DataReader (the same problem happens if I use OLEDBDataAdapter). When I run the query in Access, the value for Cash = 830.004999999999, SC = 1692.5 and Profit = -862.495000000001....more >>

Loading a generic collection from a SqlReader?
Posted by Dave at 3/27/2008 1:35:01 PM
Hi, is there any underlying difference between loading a generic collection from a reader using the two methods: List<User> colUsers = new List<Users>(); while (reader.Read()) { User user = new User(); user.FirstName = (string)r...more >>

LINQ-to-SQL transaction problem in calculated property
Posted by Jakob Lithner at 3/27/2008 8:08:00 AM
I have a DBML object that maps database to objects. In the partial Text class I added a couple of calculated properties. Several of them are dependant on how many child object are related to the current object. To avoid duplicate database calls I got the idea to set local variable _childrenC...more >>

The user instance login flag is not supported on this version of S
Posted by Morris Neuman at 3/26/2008 7:59:01 PM
I copied a C# project from one machine to another both XP Pro with VS2005. Then solution compiles but when I run the app I get the error message on the first dataadapter.FILL() command: "The user instance login flag is not supported on this version of SQL Server. " SQLExpress and SQ 200...more >>

Get return code from SQL Server Sproc?
Posted by Smokey Grindel at 3/26/2008 2:02:57 PM
Say I have a procedure that returns a return code like the following... CREATE PROCEDURE TestProc AS BEGIN SET NOCOUNT ON; SELECT * FROM MyTable; RETURN 10 END And I execute that in a sql command object, how does my client application get the return c...more >>

Help with multiple connector/table query
Posted by Alan Morris at 3/26/2008 10:11:26 AM
As a newbie to ADO.NET I am struggling with the following: I have an ODBC data table that I want to use a source for updates to a SQL server table, I envisage the sql query having the following structure:- INSERT INTO SQL_TABLE FROM SELECT ODBC_TABLE WHERE ODBC_TABLE.KEY NOT IN (SELECT SQL_...more >>

Obtaining a List of Databases
Posted by Robert E. Flaherty at 3/26/2008 8:00:13 AM
I can use the SqlDataSourceEnumerator to get a list of SQL Server instances. How do I obtain a list of databases in a given SQL Server instance?...more >>



OracleClient, Oracle 10g, Connection failure
Posted by davebythesea at 3/26/2008 2:55:00 AM
Hi, I'm trying to connect to an Oracle database via a .NET web service running in IIS on a Windows 2000 server. I am using the OracleClient (System.Data.OracleClient) provider . When I call connection.Open() I get the following error - 'System.Data.OracleClient requires Oracle client ...more >>

Handling concurrency violations
Posted by John at 3/26/2008 2:00:41 AM
Hi I have developed the following logic to handle db concurrency violations. I just wonder if someone can tell me if it is correct or if I need a different approach.Would love to know how pros handle it. Thanks Regards Dim dc As DataColumn Dim drCache As DataRow ...more >>

Connection Open Error
Posted by Pattnayaks@gmail.com at 3/25/2008 8:10:20 PM
Hi, Below is the piece of code i am using for my connection object & database transaction. private SqlConnection _mConnection; private SqlCommand _mCommand; private SqlTransaction _mTransaction; public SqlDataAdapter CreateDataAdaptor(string comText, Command...more >>

Getbytes usage from VS 2003 to VS2005
Posted by Jeff at 3/25/2008 1:31:01 PM
When accessing a BLOB from a DB using getbytes, 0 bytes are returned. The same thing worked with VS2003. The recent environmental change was from VS2003 to VS2005 and also from .NET 1.1 to .NET 2.0. /* Here is the function that reads the blob from the db */ private bool GetImageSeq(ref b...more >>

Update query that won't take DBNull
Posted by michael at 3/25/2008 1:21:03 PM
I have a stored procedure that I let the wizard create a function in the QueriesTableAdapter class. Some of the parameters to the stored procedure clearly allow for nulls (AllowDBNull) but somehow the wizard refused to add the Global.System.Nullable(Of String) to the generated function's param...more >>

Databinding en un Combobox
Posted by jmrsuarez@gmail.com at 3/25/2008 10:10:22 AM
Hi, i am using a list named ListaCombo to populate a combo box with a query, but when i execute the code, comboBox1.DisplayMember = "Display"; it thows a "The connection is already Open (state=Open)" error messages. anyone can give me idea? thanks //TextDate.Text = "H...more >>

Guarantee read lock in transaction?
Posted by Jakob Lithner at 3/25/2008 8:23:02 AM
I have a SQL table where the PrimaryKey column ID is a long. There is a ForeignKey relation from column ParentID back to the same table to track relation. Default for new records is always to relate back to itself. I don't really care what value is used for ID on new records, but as I need ...more >>

Compacting and repairing access 2000 db
Posted by John at 3/25/2008 1:17:02 AM
Hi Is it possible to compact and repair an external access 200 database via code? Thanks Regards ...more >>

LINQ with switch statement
Posted by Ant at 3/24/2008 5:59:01 PM
Hi, I'm trying to use a swithc statement in a LINQ query but its not ahppy at all. Any ideas as to the correct way to go about this? Many thanks for any ideas Ant Below is the statement: var resultSet = from p in db.Projects where p.ProjectCode == textboxProjectC...more >>

drop column via ODBC with "active relation"
Posted by Olaf Krause at 3/24/2008 5:10:11 PM
Hi, Situation: * Access to a MS Access DB via ODBC * Two columns of two tables a related (checked with MS Access GUI) * I want to delete (drop) one colum of one table (which is not a key column) but related to the other table code: commandstr="ALTER TABLE "+Name+" DROP COLUMN "+sche...more >>

dbml metadata
Posted by Chuck P at 3/24/2008 9:40:07 AM
Is their a way to get the dbml metadata at runtime. For example I would like to see the datatype and length for the LastName field. ...more >>

Query Parameter prefix in Oledb
Posted by peter.taslimi@hotmail.com at 3/24/2008 7:31:52 AM
I am trying to create a parametrized query based on City on the customers table in Northwind.mdb. The sql version on Northwnd.mdf works fine using @City in the query, but when I try to create it for the access dataset, it puts single quotes around the '@City'. Is there another character one ha...more >>

Using sender object in event handler
Posted by Ant at 3/24/2008 1:28:01 AM
Hi, I'm tring to use the event handler in the statement completed event of a command object to retrieve the value of the output parameter passed from the SP. When I try to do this, I get an 'Object referece not set to an instance of an object' What is going wrong here? Isn't sender the ...more >>

Organize Data in a DataSet
Posted by Lore Leunoeg at 3/23/2008 6:46:31 PM
Hello I'm busy with a client application which is working on client-data. Client data are spread over several 1:n tables in the database. How should I organize data in the dataset(s) ? 1) Create one dataset for each client with the tables which select only the data specific to this clien...more >>

Need some advice
Posted by Mark Moeykens at 3/22/2008 5:35:00 PM
I'm building a WPF app for single users. They enter data, saves to xml file. They can share this xml document with others who have the same app. I wanted to keep it simple so basically when they open the xml file I do a: DataSet.ReadXml("filePathToXml"); When they save their work I do a: Dat...more >>

Strongly Typed DataSet and 10,000+ records as a LookUp
Posted by stuppi at 3/22/2008 8:21:01 AM
We are using a typed DataSet containing one table with an adapter. 10,000 records in the table is a fair estimate used to point out our concerns regarding the resources consumed by using the DataSet as the DataSource of a ComboBox. Please put aside the fact that a 10,000 record LookUp may be...more >>

Connection timeout
Posted by Ant at 3/21/2008 2:25:03 AM
Hi, I am trying to run a SP that takes about 90 seconds to complete. If i run it from SQL Server, it completes ok but if I run it from my .NET application, I get a timeout error after about 40 seconds. I set the Connection timeout in the connection string builder to 180 but it still time out...more >>

Dynamically created data source for GridView
Posted by John at 3/20/2008 3:25:33 PM
Hi I have a SQL string on the lines; "SELECT a,b, c FROM MyTable WHERE MyTable.d = '" & Me.MyField.text & "'" The value of Me.MyField is provided at runtime by user. I need to assign the resultset of this SQL to an UltraGrid for view only i.e. no editing just display. My questions are; ...more >>

Asynchronous SQL comand execution ?
Posted by Murali at 3/20/2008 2:16:43 AM
Hi all, How I can use the ADO.net 2.0 , asyn sql command execution ? Murali...more >>

size of a varchar field in SQLserver table
Posted by ton at 3/19/2008 9:41:21 PM
Hi, In ADO I could read the property .DefinedSize of a field of a recordset to determine the max size of the field. This is very usefull to set the maxlength property of a textbox. How can this value be determined in the ADONET- Dataset or datatable. thanks for a reply Ton ...more >>

TableAdapter to create new SQL stored proc with different owner
Posted by Nick at 3/19/2008 7:38:01 PM
Hi Gang, I'm curious if this is a bug in Studio or not. Here's the background: Our system has SQL Server installed and our DBA's all create our databases. We are not DBOs in any of those databases. We do have rights to create stored procs, they all show up as our name in the owner field. ...more >>

odd timeout problem
Posted by guy at 3/19/2008 3:40:00 AM
c#2008 / sql server 2005 I have a stored proc that takes 2 parameters if run it through management studio either with pramaeters x,y or a,b it correctly returns the same set of data (about 100 rows) in about 1 (one) second if i run it through my c# test harness (using a dataadapter fill) ...more >>

TIMESTAMP parameter: SqlDbType.Timestamp or SqlDbType.VarBinary?
Posted by TR at 3/18/2008 12:37:03 PM
When using VB.Net, what type do you choose for a TIMESTAMP parameter? SqlDbType.Timestamp OR SqlDbType.VarBinary And what size do you enter? 8? Regards TR...more >>

ll_exists_after_“Using_Block”
Posted by JeffDotNet at 3/18/2008 11:57:03 AM
I was testing a method that updates several stronglytyped tables with a sqltransaction and noticed that the number of connections never returned to zero until I exited my application. (It ended with 1 connection) My code had made use of the "using" statement so that the connection would b...more >>

Datasource from string
Posted by John at 3/18/2008 1:59:26 AM
Hi Is it possible to create a datasource for dataview control for an sql string? Thanks Regards ...more >>

Storing data in a local database
Posted by Debbie.Croft@nospamforme.com at 3/17/2008 6:09:56 PM
I'm writing an application that needs to store data locally (in C#). This will be deployed on end-user machines (XP, Vista and 2003 Server). I want to store the data in a database. The volume of data is not huge (about 1 to 5 megs). My question is what database to I use? I can only assume t...more >>

SqlException after Adapter.Update: how to determine the source column and parameter involved?
Posted by TR at 3/17/2008 3:16:36 PM
I am at this point (<<<) in my Insert logic against a SQL2000 back-end: Try .... MyDataset.Tables(0).DefaultView.RowStateFilter = DataViewRowState.Added If MyDataset.Tables(0).DefaultView.Count > 0 Then Adapter.Update(MyDataset.Tables(0)) End If Catch ex as Exception RaiseEve...more >>

sqlcommand question
Posted by param@community.nospam at 3/17/2008 1:26:12 PM
Hi all, I have a SQLCommand object that has been set with a Stored Proc & the required parameters. I would like to somehow retrieve the sql text that is sent to sql server as a result of execution of this command object. Is that possible? So basically I want to extrapolate the text that ult...more >>

exception GetType
Posted by John at 3/15/2008 9:02:03 PM
Hi What is the purpose of exception.GetType and what are the possible values returned by it? Can it for example tell me if the exception is of type DBConcurrencyException? Thanks Regards ...more >>

BindingSource.Current is null on position change.
Posted by Gerard at 3/15/2008 3:25:30 PM
Hi I am trying to do a 1 to many relationship using dynamic textboxes, binding navigator and a filter. It works on form_load but when i change to the next row on the bindingNavigator I get. "Object reference not set to an instance of an object." Here is the code: DataRowView...more >>

Cloning A DataRow
Posted by Scott M. at 3/15/2008 1:11:35 PM
I need to copy an entire row of a typed DataSet so that I can place it into a different instance of the same type of typed DataSet. I don't see a clone or copy method on the DataRow. Do I have to create and populate the row manually? -Scott ...more >>

Trapping data update exceptions
Posted by John at 3/15/2008 2:28:49 AM
Hi I am updating a datatable in a dataset as below; daMyAdpater.Update(MyDataSet.MyTable) How can I trap various different exceptions that may occur during this update process? Thanks Regards ...more >>

Datarow to string
Posted by John at 3/15/2008 2:07:07 AM
Hi How can I save all values in a system.data.datarow to a string? I need this for error logging purposes. Thanks Regards ...more >>

SQL Connection in detail
Posted by Markus Hirsch at 3/13/2008 9:45:54 PM
Hi, I have a dotnet 2.0 application, that uses the connection pool to connect to a sql server. That works pretty good. Which kind of authentication is used between the application server and the sql server when persistent connections are used? When I use my sniffer to look into the pack...more >>

"Importing" my existing classes to a dbml?
Posted by Andy at 3/13/2008 10:03:31 AM
Hi, I'm currently moving (slowly) to use Linq to Sql to replace my custom data access layer. Fortunately, my DAL worked very similar to L2S as far as the use of classes goes; each table is decorated with attributes that tell my DAL how to do what it needs. At first glance, it seemed all I ...more >>

Create LINQ to SQL without Visual Studio?
Posted by coconet at 3/12/2008 3:48:27 PM
How can the .dbml be created programmatically? If I don't want to use the full GUI designer and instead want to automatically build associated data classes when the DB schema changes, how can I do that? Thanks. ...more >>

Adding Rows to Data-Bound DataGridView
Posted by jp2msft at 3/12/2008 1:53:02 PM
A data-bound DataGridView is wonderfully simple to include with a Windows Form. Now that all the data is there, how do I go about adding a new record? When I tried, Visual Studio 2005 Pro gave me an InvalidOperationException, saying, "Rows cannot be programmatically added to the DataGridView'...more >>

Suggestions to track monthly payments?
Posted by Kevin O'Brien at 3/12/2008 12:09:13 PM
Hello everyone, I am designing an application around a dance school. The school is open for 10 months - September-June. The students pay a monthly tuition. Anyone have any suggestions on how to track the payments? I'm trying to design the table layout and am hitting a mental block. Any sugg...more >>

TableAdapter Updating
Posted by jp2msft at 3/12/2008 10:37:02 AM
I have one TableAdapter that has 2 custom updating functions, 1 insert, and the default Fill. In my 2 custome updating functions, one function updates some fields, whereas the other function updates the other fields (we do not always want to update all records). The problem is, when I ca...more >>

No update happening
Posted by David at 3/12/2008 9:05:47 AM
I am using SQL Server 2005. I have a form with a grid on it. I have this code in place: String strFilter = String.Format("Line={0} AND Time='{1:D2}/{2:D2}/{3:D4} {4:D2}:{5:D2}'", m_cd.m_iLine, m_cd.m_dt.Mont...more >>

What's new in ADO.NET
Posted by Gabriel at 3/12/2008 6:42:05 AM
Hello, What's new in ADO.NET framework 3.5 about new features, changes, improvements ? Regards, ...more >>

datacolumn
Posted by thams at 3/12/2008 2:24:00 AM
is it possible to get the size of the datatype of a datacolumn in a datatable? i want to show the datatype with the size of a table. first i got the table in a dataset. then i try to catch the datatype. all are working fine? but my question is "is it possible to get the datasize ie. like varch...more >>


DevelopmentNow Blog