473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Useing OLEDBDataAdapter

Declared a static object variable for OLEDBCommand and OLEDBDataAdapter.
Instantiate both of them. Set the command object to the SelectCommand
property of the OLEDBDataadapter.

Assign the commandtext of the command object. And call the fill function of
the dataadapter. Works fine for several postbacks. But, then for some odd
reason the selectcommand property on the dataadapter changes to null. The
command object that was associated to the selectcommand property is still
valid (not null) as well as the dataadapter object itself. Only the
selectcommand property. Any ideas how that can happen. Not calling any
..Dispose method.
Oct 9 '06 #1
1 1021
Not wise to make database objects static, as the base setup uses an
underlying pool for the connection objects, which, to an extent, cascades
up. As a static variable, everyone shares it, which can be an issue, as
well. I would not store command objects in this manner. Sotring parameter
objects is acceptable, which is what MS does in the block.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
"Roger" <Ro***@discussions.microsoft.comwrote in message
news:83**********************************@microsof t.com...
Declared a static object variable for OLEDBCommand and OLEDBDataAdapter.
Instantiate both of them. Set the command object to the SelectCommand
property of the OLEDBDataadapter.

Assign the commandtext of the command object. And call the fill function
of
the dataadapter. Works fine for several postbacks. But, then for some odd
reason the selectcommand property on the dataadapter changes to null. The
command object that was associated to the selectcommand property is still
valid (not null) as well as the dataadapter object itself. Only the
selectcommand property. Any ideas how that can happen. Not calling any
.Dispose method.

Oct 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jtsree | last post by:
I am Using (Windows XP) Visual Studio.net 2003 professional edition working on VB.net language. I am bulding a very very simple project in VB.net where i connect to Access Database by dragging...
2
by: Son Ha | last post by:
I want to copy some record from a Access database to another Access DB. My code as follow but not working. The destAdapter.Update() return 0 record affected. Tell me what's wrong in my code? ...
1
by: Bennett Haselton | last post by:
Suppose I add a new row to a table in a dataset, and then I use an OleDbDataAdapter to add that new row to a SQL Server database using OleDbDataAdapter.Update(), as in the following code: ...
4
by: shachar | last post by:
hi all(i tried yesterday but it didnt work). i wrote this code and i get an error msg: Private Pr_MyCon As System.Data.OleDb.OleDbConnection Private Pr_DataSet As DataSet Private Pr_DataAdapter...
1
by: RML | last post by:
Hi everyone, I am using VB.NET 2003 and an OleDBDataAdapter to update an Access table's DateTime field. The field's format is set to "General Date" (ie: 11/24/2004 8:00:00 AM). The problem is...
1
by: Herman P via DotNetMonster.com | last post by:
Dear friends; I am trying to cofigure Oledbdatadabter with wizard. And i am using ACCESS database.I want to use parameter in OledbDataadapter Select Command Property window. I have simple form...
6
by: Marcel Hug | last post by:
Hi all ! I have a table in my database, which has 3 attributes. IDFailureControl, ControlDate and ControlVersion. In the following function I test, if the date of today allready exists. Then I...
6
by: tom c | last post by:
I create 2 data OleDbDataAdapters, one with the wizard, and one in code. I know the adapter created in code is OK because I use it to fill a data table. However, when I try to use the same SQL...
6
by: baldrick | last post by:
Hello, I am trying to plonk the entire contents of a dBase file into an Access table. I have scanned the dBase fields and created an empty Access table with the same field formats. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.