OlsDbCommand.Cancel does not stop SQL
Dear Newsgroup
when I kick off stored procedure through an OleDbCommand, it seems impossible to stop it again. In a different thread, I call OleDbCommand.Cancel, but this call waits for the stored procedure to finish instead of killing it. Unlike SQL Query Analyzer, my c#-programm can not interrupt a running stored procedure
What's the trick ?? Tag: Visual Database Tools and Oracle 9i Tag: 87355
getting ADO-like properties from OleDbConnection
ADO connection objects had a Properties array which you could iterate
to determine connection string values, such as "Persist Security Info"
and the like.
Is there any facility in ADO.NET to do this aside from parsing the
ConnectionString? Tag: Visual Database Tools and Oracle 9i Tag: 87348
General Network Error
I get the following exception when doing a simple
statement like SELECT * FROM MyTable, I am using SQL
Server 2000 and ADO.Net as the client using framework
1.1, I get this error periodiodically.
Please help,
Exception message:
iE.AM.Runtime.AMSQLException: Unable to perform SqlCmd ---
> System.Data.SqlClient.SqlException: General network
error. Check your network documentation.
at System.Data.SqlClient.SqlConnection.OnError
(SqlException exception, TdsParserState state)
at System.Data.SqlClient.SqlInternalConnection.OnError
(SqlException exception, TdsParserState state)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.ReadNetlib(Int32
bytesExpected)
at System.Data.SqlClient.TdsParser.ReadBuffer()
at System.Data.SqlClient.TdsParser.ReadByteArray(Byte
[] buff, Int32 offset, Int32 len)
at System.Data.SqlClient.TdsParser.ReadDouble()
at System.Data.SqlClient.TdsParser.ReadValue
(_SqlMetaData md, Int32 length)
at System.Data.SqlClient.TdsParser.ProcessRow
(_SqlMetaData[] columns, Object[] buffer, Int32[] map,
Boolean useSQLTypes)
at System.Data.SqlClient.SqlDataReader.PrepareRecord
(Int32 i)
at System.Data.SqlClient.SqlDataReader.GetValues(Object
[] values)
at
iE.AM.Sql.Utilities.SqlBase.ProcessSqlCurOpenOperation
(Object param)
--- End of inner exception stack trace ---: General
network error. Check your network documentation.: at
System.Data.SqlClient.SqlConnection.OnError(SqlException
exception, TdsParserState state)
at System.Data.SqlClient.SqlInternalConnection.OnError
(SqlException exception, TdsParserState state)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.ReadNetlib(Int32
bytesExpected)
at System.Data.SqlClient.TdsParser.ReadBuffer()
at System.Data.SqlClient.TdsParser.ReadByteArray(Byte
[] buff, Int32 offset, Int32 len)
at System.Data.SqlClient.TdsParser.ReadDouble()
at System.Data.SqlClient.TdsParser.ReadValue
(_SqlMetaData md, Int32 length)
at System.Data.SqlClient.TdsParser.ProcessRow
(_SqlMetaData[] columns, Object[] buffer, Int32[] map,
Boolean useSQLTypes)
at System.Data.SqlClient.SqlDataReader.PrepareRecord
(Int32 i)
at System.Data.SqlClient.SqlDataReader.GetValues(Object
[] values)
at
iE.AM.Sql.Utilities.SqlBase.ProcessSqlCurOpenOperation
(Object param) Tag: Visual Database Tools and Oracle 9i Tag: 87345
Creating Access 97 database programatically
HI ,
Can anyone tell me how can i create a .mdb(access 97) database using ado.net in vb.nety.
I dont want to use adox.
Can this be acheived in ado.net .
any help will be appreciated.
Cheers,
Jiten
---
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching. Tag: Visual Database Tools and Oracle 9i Tag: 87342
"A connection pooling error has occurred." exception thrown randomly when SqlConnection.Close(). (In Dispose() method)
I'm making a databse management tool with VS.NET 2003 C#.
The InvalidOperationException occured RANDOMLY.
"A connection pooling error has occurred."
I'm accessing SQL server 2000 (MSDE Release A) through SqlConnection.
The database that I'm using is set as SINGLE USER by EM.
So I created one connection object and reused it repeatly.
(Connection is keeping open during application is running.)
No exception when working and running, but the exception thrown when
application closing. (Exactly, when SqlConnection.Close () method called.)
I searched ms .net newsgroup (by google), I know I have not to use
SqlConnection.Close() in any destructor routine, and my code has no
destructor at all project. (Even no "~" character on whole sources.)
I didn't call Close() method at any destructor, and Close () method is
places on Dispose() method currently.
My SqlConnection is wrapped by a component that placed on a form by the
designer.
PS.
I have to use SINGLE USER option, cause there is special reason, please
don't discuss about it.
THIS IS EXCEPTION DETAILS:
- $exception {System.InvalidOperationException}
System.InvalidOperationException
- System.SystemException {"A connection pooling error has occurred."}
System.SystemException
- System.Exception {"A connection pooling error has occurred." }
System.Exception
System.Object {System.InvalidOperationException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2146233079 int
_innerException { } System.Exception
_message "A connection pooling error has occurred." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
+ _stackTrace {System.Array} System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2146233079 int
InnerException { } System.Exception
Message "A connection pooling error has occurred." string
Source "System.Data" string
StackTrace " at System.Data.SqlClient.SqlConnection.Close()\r\n at
F176.Database.Generator.Dispose()\r\n at
F176.Database.Server.Dispose()\r\n at
F176.Database.Manager.Dispose(Boolean disposing)\r\n at
System.ComponentModel.Component.Finalize()" string
+ TargetSite {System.Reflection.RuntimeMethodInfo}
System.Reflection.MethodBase
+ this {F176.Database.Generator} F176.Database.Generator Tag: Visual Database Tools and Oracle 9i Tag: 87339
"A connection pooling error has occurred." exception thrown randomly when SqlConnection.Close(). (In Dispose() method)
I'm making a databse management tool with VS.NET 2003 C#.
The InvalidOperationException occured RANDOMLY.
"A connection pooling error has occurred."
I'm accessing SQL server 2000 (MSDE Release A) through SqlConnection.
The database that I'm using is set as SINGLE USER by EM.
So I created one connection object and reused it repeatly.
(Connection is keeping open during application is running.)
No exception when working and running, but the exception thrown when
application closing. (Exactly, when SqlConnection.Close () method called.)
I searched ms .net newsgroup (by google), I know I have not to use
SqlConnection.Close() in any destructor routine, and my code has no
destructor at all project. (Even no "~" character on whole sources.)
I didn't call Close() method at any destructor, and Close () method is
places on Dispose() method currently.
My SqlConnection is wrapped by a component that placed on a form by the
designer.
PS.
I have to use SINGLE USER option, cause there is special reason, please
don't discuss about it.
THIS IS EXCEPTION DETAILS:
- $exception {System.InvalidOperationException}
System.InvalidOperationException
- System.SystemException {"A connection pooling error has occurred."}
System.SystemException
- System.Exception {"A connection pooling error has occurred." }
System.Exception
System.Object {System.InvalidOperationException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2146233079 int
_innerException { } System.Exception
_message "A connection pooling error has occurred." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
+ _stackTrace {System.Array} System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2146233079 int
InnerException { } System.Exception
Message "A connection pooling error has occurred." string
Source "System.Data" string
StackTrace " at System.Data.SqlClient.SqlConnection.Close()\r\n at
F176.Database.Generator.Dispose()\r\n at
F176.Database.Server.Dispose()\r\n at
F176.Database.Manager.Dispose(Boolean disposing)\r\n at
System.ComponentModel.Component.Finalize()" string
+ TargetSite {System.Reflection.RuntimeMethodInfo}
System.Reflection.MethodBase
+ this {F176.Database.Generator} F176.Database.Generator Tag: Visual Database Tools and Oracle 9i Tag: 87338
Transaction deadlock
Hi All,
Does anyone know how to prevent dead lock when
selecting records within Transaction??
Let me describe abit clear.
I created & open a transaction and before i commit/ rollback the transaction
i have to select few records within the same table
but the problem is once i execute a select sql statement for serveral times
(usually more than 2 times)... the select sql will be hold and the whole
application will be hung...
I guess the reason is because the transaction haven't finished
and as a result the select sql should be on queue
I have tried various solutions like changing the transaction level ... but
none of them work as needed
so.. please tell me if anyone know the solutions... thanks to all
Ivan Tag: Visual Database Tools and Oracle 9i Tag: 87335
sqlpp framework
hi!
Have someone work with the sqlpp framework
so we can share experiences.
sqlpp is a full Database Abstraction Layer Generator.
Since version 2.14 sqlpp use a xml to generate c# modell and connection
classes, sql querrys and stored procedures.
Some interesting features are:
* No SQL manipulation: with the generator, you don't write a
single line of SQL,
* Multiple Database system support: MSSQL, MySQL. Others could be
implemented easily,
* Handles the stored procedure problem by storing the queries in the
web.config if necessary,
* Supports complex table join: the generator uses the
Boost.Graph.Library on the background to generate the queries
* The C# code is documented !
* It's totally free for non-commercial and commercial use!!!
(source http://www.codeproject.com/cs/database/dalgen.asp
is not up tp date)
project homepage:
http://sourceforge.net/projects/sqlpp/ Tag: Visual Database Tools and Oracle 9i Tag: 87332
Are ado.net apps supported on this platform
Hi
Can I write ado.net apps that would run on this device;
http://www.xda-2.co.uk/under_the_bonnet.html
If yes, is an emulator available?
Thanks
Regards Tag: Visual Database Tools and Oracle 9i Tag: 87324
MS DataProvider for Oracle / GUIDs
Hi there,
are there any future plans to support the GUID datatype within MS
DataProvider for Oracle? GUIDs could easily be mapped to a RAW(16)
coulnn. Right now I have to do on-the-fly conversion (GUID to
Bytearray), and still, OracleCommandBuilder does not seem to map
Bytearrays to RAW-columns either (optimistic locking syntax fails on
equals operator, as the Bytearray is expanded to lowercase symbols
(e.g. 'ff'), where Oracle expectes uppercase symbols).
Kind regards,
Arno Huetter Tag: Visual Database Tools and Oracle 9i Tag: 87319
Replication notification.
I am calling a web service that is generating some data that will be replicated to a SQL Server. I would like to know what is the best way to wait for the replication. I would either like to have a function that does not return until replication occurs on a specified table (this particular replication will add a row although there are some instances where the row is simply updated) or somehow flush the information that is replicated. The problem that I am seeing is I am calling the web service but when I look at the DB the row is now present. I have tried to sleep for up to 10 seconds and still I don't see the added row. If I run query analyzer after the web service call I can see the added row. It seems that the thread that called the web service never sees the updated record. Any suggestions
Thank you
Kevin Burto
kburton@visa.co Tag: Visual Database Tools and Oracle 9i Tag: 87317
Dynamic CommandText for an SqlDataAdapter
I'm using a DataGrid to display and edit entries from a database=
table called Contacts=2E I've completed the MSDN document=
"Walkthrough: Using a DataGrid Web Control to Read and Write=
Data" and it's working out fine=2E My SQL select command looks=
like this:
SELECT Id, Name, Phone, Email FROM Contacts
Now I want to restrict that query to only display entries with a=
certain OrganizationId=2E The OrganizationId I want to use can be=
found in Session["OrganizationId"]=2E I basically want this:
SELECT Id, Name, Phone, Email FROM Contacts WHERE OrganizationId=
=3D THE_ID_FROM_THE_SESSION
What I'm asking is how I should do this=2E I've tried editing the=
sqlSelectCommand manually in "Web Form Designer generated code"=
that was generated for me by the SqlDataAdapter wizard, but if I=
even touch that code, VS=2ENET freaks out and removes the=
CommandText property completely (and then I am unable to re-add=
it!)=2E I guess I could add it via the properties for the=
SelectCommand for the SqlDataAdapter in design mode, but I can't=
see how to add dynamic data such as a session variable in that=
textbox=2E What am I missing/doing wrong?
--------------------------------
From: Rickard Andersson
-----------------------
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)
<Id>Tbf5aLbxl0q3Fn6LEuWR9A=3D=3D</Id> Tag: Visual Database Tools and Oracle 9i Tag: 87311
SortOrder's column in GetOLEDBSchemaTable
Hi,
How do I know SortOrder(ASC or DESC) of key fields in ADO.NET?
I could get SortOrder by using ADOX.
I can't find near column by GetOLEDBSchemaTable.Primary_Keys/Foreign_Keys.
Thanks
Tom
--------------------------------
From: Tom Hadler
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>z96rY7znZU2INR0oSrCqQg==</Id> Tag: Visual Database Tools and Oracle 9i Tag: 87310
nothing or dispose
hi
iam closing the connection and later iam using dispose method
should i need to use nothin
is it neccessary to use nothing for an object??????
pls give me suggestion Tag: Visual Database Tools and Oracle 9i Tag: 87309
creating a setup to install into GAC, where can I find an example?
Could anyone suggest me some examples/articles on creating a setup program
in VS.NET that can install the assembly into the GAC? I have done some
search and research myself and have some basic understanding on how to
create a setup program. All the articles about Windows Installer 2.0 is the
best way to install your assembly into GAC but I haven't found one shows
what exactly I need to do differently in my VS.NET setup project in order
for it to stick the assembly into GAC.
Bob Tag: Visual Database Tools and Oracle 9i Tag: 87303
Strongly typed DataSet with xsd.exe
I generate an XML file with the WriteXmlShema method of the DataSet object.
Then, I use xsd.exe to make it a strongly typed DataSet, witch generate a
Visual basic code file, MyDataSet.vb.
xsd.exe /d /l:VB "MyDataSet.xsd"
When I add both files, MyDataSet.xsd and MyDataSet.vb, to my Visual Studio
project, MyDataSet.vb does not appears as a child node of MyDataSet.xsd like
when you create a strongly typed Dataset by dropping a table on the DataSet
designer.
Is there a way to tell VSNet that MyDataSet.vb is to be linked with
MyDataSet.xsd?
Thanks a lot
Frederic Goulet Tag: Visual Database Tools and Oracle 9i Tag: 87301
Exporting XML Schema
This is a multi-part message in MIME format.
------=_NextPart_000_00A3_01C4382A.B02408F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I know there is a way to do this as I have done it before with Crystal =
Reports tech support on the phone. I (mistakenly) have misplaced that =
code. What I need to do is convert a dataset into an XML schema file =
that I can use to generate another Crystal Report.=20
Thanks in advance for any help that you can give me.
------=_NextPart_000_00A3_01C4382A.B02408F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I know there is a way to do this as I =
have done it=20
before with Crystal Reports tech support on the phone. I (mistakenly) =
have=20
misplaced that code. What I need to do is convert a dataset into an XML =
schema=20
file that I can use to generate another Crystal Report. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance for any help that you =
can give=20
me.</FONT></DIV></BODY></HTML>
------=_NextPart_000_00A3_01C4382A.B02408F0-- Tag: Visual Database Tools and Oracle 9i Tag: 87299
What's the benefit of using VS.Net's "Generating Dataset..."?
This may be a newbie question.
I used to just define (VB.Net for example):
dim dt as new DataTable
dataAdp.fill(dt)
But in VS.Net,
You can also right click the SQLDataAdapter1 component and click
"Generating Dataset...", after specify a name, the new xsd file will be
created as well as a correspond vb file. The VB file basically created
another class inherit DataSet class.
But in the vb code, it seems still need to do:
dataApt.fill(AutoGeneratedDataset, "SameNameOfTheTableWhenGenerating")
What's the benefit to use this function of VS.Net? I know one is you can
use the visual tool to do data binding after you have generated dataset
placed on the form designer.... Others? Tag: Visual Database Tools and Oracle 9i Tag: 87297
Populating disconnected ADODB.Recordset with System.Data.DataTable data.
I need to support a VB6 application that will be receiving
disconnected ADODB.Recordset from out DotNet solution. Our dotnet
solution deals with System.Data.DataTable. I need to populate a
disconnected ADODB.Recordset from System.Data.DataTable data. Below
is the source code I am implementing to test the process. I do not
get any error, that I can see. The problem I have is that at the end,
the recordset seems to be empty. Any suggestions are very much
appreciated. At this moment I do not know what to do.
Thank you so much for the time and effort you may spend on this
matter.
Elcc.
private bool testConvertDT_RS()
{
System.Data.DataTable dt;
ADODB.Recordset rs;
// create dummy data table.
dt = PopulateDataTable( );
// attempt to populate disconnected ADODB.Recordset
with System.Data.DataTable data
rs = ConvertToRS ( dt );
if( null == rs )
{
throw new Exception(" Recordset is null.");
}
if( 0 == rs.Fields.Count )
{
throw new Exception(" Recordset Field count is zero.");
}
return true;
}
private System.Data.DataTable PopulateDataTable()
{
System.Data.DataTable dt = new System.Data.DataTable();
System.Data.DataRow dr;
string[,] ColValues = {{"R1-C1", "R2-C1", "R3-C1", "R4-C1", "R5-C1"}
, {"R1-C2", "R2-C2", "R3-C2", "R4-C2", "R5-C2"} ,
{"R1-C3", "R2-C3", "R3-C3", "R4-C3", "R5-C3"}};
dt.Columns.Add(new System.Data.DataColumn("Column01",
System.Type.GetType("System.String")));
dt.Columns.Add(new System.Data.DataColumn("Column02",
System.Type.GetType("System.String")));
dt.Columns.Add(new System.Data.DataColumn("Column03",
System.Type.GetType("System.String")));
for( int i = 0 ; i < 5 ; i++ )
{
dr = dt.NewRow();
for( int n = 0 ; n < 3 ; n++ )
{
dr[n] = ColValues[ n, i];
} dt.Rows.Add(dr);
} return dt;
}
private ADODB.Recordset ConvertToRS(System.Data.DataTable dt)
{
ADODB.Recordset rs = new ADODB.Recordset();
try
{
rs.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
rs.ActiveConnection = null;
for( int i = 0; i < dt.Columns.Count; i++)
{
rs.Fields.Append( dt.Columns[i].ColumnName,
ADODB.DataTypeEnum.adBSTR,
dt.Columns[i].MaxLength,
ADODB.FieldAttributeEnum.adFldUnspecified,
null );
}
rs.Open( Type.Missing,
Type.Missing,
ADODB.CursorTypeEnum.adOpenStatic,
ADODB.LockTypeEnum.adLockOptimistic,
-1);
foreach(System.Data.DataRow dr in dt.Rows)
{
rs.AddNew(Type.Missing, Type.Missing);
for( int n = 0; n < dt.Columns.Count; n++)
{
rs.Fields[n].Value = dr[n];
}
rs.Update(Type.Missing, Type.Missing);
}
rs.Close();
return rs;
}
catch(Exception e)
{
throw e;
}
} Tag: Visual Database Tools and Oracle 9i Tag: 87295
concurrency questions
I am using an access db via ole db from an asp.net page.
When I open a connection, if there are no more connections
in IIS's connection pool it'll try and open a new
connection. If there are no more connections available
what exception get's thrown?
By the same token, when using a data adapter to do an
update, what exception gets thrown if the server (the
access mdb) is busy?
Lastly, where can I read up on this. I already know about
switching the MSDE etc. Sounds great, but not an option
for the near term.
Thanks ... Ed Tag: Visual Database Tools and Oracle 9i Tag: 87292
Storing Date/Time with Daylight savings
Dear All,
I am developing an application that will save historical data; The table is
very simple, it will have a Time Stamp column and other columns to save real
values. The application should be able to work with several different
databases. My problem now is to make a decision about the date/time to be
saved in the Time Stamp; I can use either System Time (GMT) or Local Time;
if I choose the first one, the users will get confused when they try to open
the tables using a GUI other than mine. On the other hand, if I save using
Local Time, I can have problems with Daylight saving. Does anyone have any
idea about how to avoid problems with daylight saving other than saving the
System Time?
Note: I thought about using an additional field (maybe save both, System
Time and Local Time), but I think that you experts should have a better
solution.
Thank you in advance,
Lourenço. Tag: Visual Database Tools and Oracle 9i Tag: 87290
How to handle NULL fields-error with fill method
I have a data adapter that is using a stored procedure and when I get to the fill method to fill a dataset I get the following error
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
The results of the procedure has 6 columns by 50 rows with some NULL field values throughout so think the NULLs are causing the problem. Just wondering how to handle this? Thanks Paul. Tag: Visual Database Tools and Oracle 9i Tag: 87289
OracleType.NVarChar parameters handled differently in framework 1.1?
There appears to have been a change in behaviour between handling of
OracleType.NVarChar parameters in 1.1? In my case this breaks code using
DbType.String or the IDataParameter interface with strings over 2000
characters.
A 2001 character string parameter, consisting entirely of 7 bit characters,
sent to a 9.2.0.1 stored procedure works under the optional 1.0 Oracle
driver. The exact same code and database now falls over with
"ORA-01460:unimplemented or unreasonable conversion requested" using the
supplied 1.1 OracleClient.dll.
This change in behavior leads me to the conclusion that the biggest string
you can now pass to an Oracle database using the
IDataParameter interface is now only 2000 characters, primarily because
OracleClient 1.1 maps the String native type to OracleType.NVarChar with a
4000 byte limit?
This 2000 char limit would be required to handle the possibility that the
database *may* be configured with a 16bit NLS_NCHAR_CHARACTERSET like
AL16UTF16 as is sometimes recommended by Oracle? Even though you are could
actually be inserting a plain old ascii string into a plain old
varchar2(4000)
column on a plain old USASCII7 Oracle instance?
Assuming this is the case, can anyone think of a workaround, other than
1. Having to abandon the database independent IDataParameter interface and
change all the client code to discover and use whichever native
<database>Type is appropriate for the connection?
2. Stick to strings of less than 2000 characters.
Rich. Tag: Visual Database Tools and Oracle 9i Tag: 87288
Copy data between two dataadapters
Hi,
we want to build an application which copies all data from the source to the
destination without changing anything.
We use data adapters for this process. So we open both adapters, use "fill"
on the source and give an "update" to the destination.
The problem is that the table we want to copy is quite large. So we see
quite a memory usage. So we decided to move the data in blocks, 1000 records
at a time. We use the dataadpter.fill(dataset,0,1000,tablename) to read the
first records, then we do an update, then the next fill
(dataadpater.fill(dataset,1001,2000,tablename) and loop that till EOF.
We see that the programm moves the first records quite quickly but gets
slower and slower over time. Our idea is that the dataadapter take more and
more time to skip the first records of the source to get to the real
"payload".
Is there anything we can do better? We simply want to move the first 1000
records, then the next 1000, and so on...
Thanks,
Thomas Tag: Visual Database Tools and Oracle 9i Tag: 87287
Help... last deleted row not updated
Hi group,
in a checklistbox I have some item that can occur(when checked) in a
datatable.
when I uncheck 3 items and press the update button a problem occurs.
In the Buttonevent I make a loop where I search for still excisting
unchecked(s) searching the id with dataviewtable.find().
If found the datatable.rows[found].delete() is called.
I see this happen tree times in debug mode.... so far, so good....
But when I call the adapter.update(ds[table]) only the first two rows are
really updated and the last one still is in the sql-server.
Do I have todo something extra before calling update or has any one a
solution to my problem?
Thanks in advance,
Rens Tag: Visual Database Tools and Oracle 9i Tag: 87286
Dataset WriteXML method
I have a dataset that was created from a XSD schema. I populate it with data
and use WriteXml method to create XML document. Problem is XML tags come out
in the order that is different from the order of tags in the XSD. My client
requires that XML validates against XSD, and the use XMLSPY to validate it.
I ran the same test and XMLSPY complains that tags in the wrong order. Is
there a way I can force order of tags with WriteXml method of Dataset? If
not what ate the other alternatives?
Thank you all very much Tag: Visual Database Tools and Oracle 9i Tag: 87285
DataSet/Table/Row questions
Hi..
I'm trying to port an old application to .Net and I've been exploring the possibility of using the DataSet, DataTable, and DataRow classes to make an unconnected, in-memory database for a light-weight app. I can already get myself pretty much most of the way there, but there are some questions I have
The data I'm trying to work with is serialized as XML and the XML has roughly this structure
<Root><Client id="1" total="Sum(Child(rel).cost)" updated="Max(Child (rel).updated"><Order id="1" cost="12" updated="<date>"/><Order id="1" cost="3" updated="<date>"/
..
</Client
..
</Root
I have the schema to create the DataSet and the tables; it ends up with 2 tables, a parent/child relationship, and some columns in the parent table as operations on the child table
For the most part this works pretty well, but there are a few things that are sub-optimal and I was wondering if there might be any suggestions to help smooth things out
1) I'd rather have it as one table, if I could, and then use a Select statement with something like a GROUP BY to create the summaries, but I don't see any easy way to do this. Also, there doesn't appear to be any xml serialization support below the DataSet level
2) Also, while we want to keep a certain amount of data in the in-memory database, we want to be able to select only particular nodes for serialization in xml (i.e. give me the xml tree structure only for nodes where Client.total > 100, for example). But the DataSet xml serialization doesn't seem to support any selection; it only serializes the whole database. Is the only way to work with this to serialize the whole thing out and suck it back into a DOM and do the selection with xpath? Seems a deficiency that the xml serialization doesn't support selection and/or there isn't any serialization support on the table level
3) Multiple part question
a) how expensive is it to do a DataSet.Clone, a Select and a Merge? (i.e. a way of getting a dataset with only the data I want to return)
b) Since I currently have 2 tables, I would guess I have to do separate selects on the the parent and child tables, resulting in 2 DataRow []. Is doing DataSet.Merge() going to get the row arrays into the right tables
c) given a defined relationship between parent and child tables is there any way to write a select that would get both row sets in one call
And generally, if anyone can give general tips on how to make this work better, I would appreciate it
Thank
Mark Tag: Visual Database Tools and Oracle 9i Tag: 87281
Multithreading: "There is already an open DataReader associated with this Connection"
Hi all
I am running multiple threads retrieving information from a SQL database, using sqlDataAdapter and DataSet. I regularly (but not constantly) get an exception "There is already an open DataReader associated with this Connection" thrown. Now, I know that the sqlDataAdapter uses DataReader under the hood, and that DataReader does not accept more than one connection open at a time. How might I work around this issue? Having the threads wait for eachother by calling Join() is not an option. I need to run a large number of threads calling this function
I'll add some code to (hopefully) clarify my issue. The function PollSubscriptions is called by multiple threads
private void PollSubscriptions(string devicePIN)
ArrayList subscriptions = new ArrayList()
ArrayList events = new ArrayList()
string subscriptionIDs = ""
XmlDocument XmlDoc = new XmlDocument()
try {
sqlListenerThreadDS.Clear()
sqlListenerThreadDA.SelectCommand.Parameters["@PIN"].Value = devicePIN.ToUpper()
sqlListenerThreadDA.Fill(sqlListenerThreadDS)
foreach (sqlListenerThreadDS.subscriptionsRow subscription in sqlListenerThreadDS.subscriptions)
subscriptions.Add(subscription.subscriptionID.ToString())
sqlSubscriptionsDA.Fill(sqlUserInfoDS)
foreach (string id in subscriptions)
sqlUserInfoDS.subscriptionsRow subscription = sqlUserInfoDS.subscriptions.FindBysubscriptionID(Convert.ToInt32(id))
subscription.lastPoll = System.DateTime.Now.ToUniversalTime()
sqlSubscriptionsDA.Update(sqlUserInfoDS)
catch (Exception ex)
logEntry = "Failed to poll subscriptions for device " + devicePIN.ToUpper() + ": " + ex.Message + "\n" + ex.StackTrace
eventLog.WriteEntry(logEntry, EventLogEntryType.Error)
}
Would anyone know a solution? sqlDataAdapter and DataSet are thread-safe, aren't they
much regard
Eri
erik.removethisifyourenobot@thesixthhouse.nl Tag: Visual Database Tools and Oracle 9i Tag: 87277
connection string
I apologize for such an elementary question. My connection string requires a data source. Is that the server name? The DB name is the Initial catalogue, so that isn't the data source. Thanks for the help
SMK Tag: Visual Database Tools and Oracle 9i Tag: 87269
Query is too complex
Hi,
I'm using the querybuilder when updating a (rather wide) record in a table
(Access).
However, I get a "Query is too complex" message.
It seems that for "optimistic locking " purposes, the WHERE Clause is very
complex
Any suggestions how to get this working?
Thanks in advance,
Ben Tag: Visual Database Tools and Oracle 9i Tag: 87265
How do I use store procedures?
How do I create and use "store procedures" with an SqlConnection object? I need to create a procedure that will add a record and return the new ID of said record. I know that I can accomplish this with "store procedures." If you can direct me to a simple sample, I would really appreciate it.
- Rashad Rivera Tag: Visual Database Tools and Oracle 9i Tag: 87264
Connection time out
Hi all
i´m opening a table with a few thousands of records and it allways gets me a
connection timeout.
my connection string is ( using sqlclient.sqlconnection and a
SqlDatadapter)
"User ID=sa;Initial Catalog=BD;Data Source=Server;Password =xxxx;Connect
Timeout=30000"
can someone help ..
JSB Tag: Visual Database Tools and Oracle 9i Tag: 87263
DataSet Updates fails when there are non-printable characters in a field
Hi
When I try to update my changes found in a dataset I often
get
Concurrency violation: the UpdateCommand affected 0 records.
Because one of the fields (varchar) contains a single TAB chr(9) or
a single CRLF pair of characters.
How can I fail-safe my update code so that even these characters
can get updated?
I guess it is because of the tests that the command-builder
object creates that doesn't like non-printable characters.
Perhaps they should be escaped properly? but how can I do that?
It is frustrating moving to ADO.NET from ADO finding that now
updates fails because there's some odd content in the fields!
Any ideas for simple solution?
//Andy Tag: Visual Database Tools and Oracle 9i Tag: 87262
Named Pipes alias in web.config
I'm trying to use a named pipes alias in a connection string in a
web.config file.
At the moment, my string looks like this:
"Application Name=test1;Data Source=richtest;Network=DBNMPNTW;Initial
Catalog=richdb1;Integrated Security=SSPI" />
I'm guessing that the problem is the "richtest" alias seems to just be
read as a DNS name - ie. I think it assumes it's a machine called
richtest and it tries to resolve that name to an IP address.
The richtest alias is set up in the SQL Client Network Utility as a
named pipes connection and works fine for other applications.
The connection string works if I use the actual pipe name
(\\richserver1\pipe\MSSQL$SQ2\sql\query), but I want to avoid doing
that if I can, just in case it changes. If I can use the alias, it
means I only have to change the alias if the database location
changes, and I don't have to worry about other things stopping working
because of hard-coded pipe names.
Any help with this would really be appreciated.
Rich Tag: Visual Database Tools and Oracle 9i Tag: 87261
Request for details on XML-MSDATA Schema
I request that Microsoft's .Net team publish the schema indicated by: 'urn:schemas-microsoft-com:xml-msdata', or at least publish a document describing all of the attributes (and elements?) defined in the said schema.
I'm developing an ASP.net application using datasets, on a very time restriced schedule, and so the details of the said schema would be extremely helpful in manually crafting the XSD file used by my application. Tag: Visual Database Tools and Oracle 9i Tag: 87250
commandBuilder Update SQL generation for > 1 table?
In ADO, I could issue a query (using an MSS provider) which returned a
result set from multiple tables, and update the data in a grid and
post it. (I'm actually not quite sure how that works but it does).
In ADO.NET I can't do this, I have to roll my own UPDATE, which isn't
possible for ad-hoc queries.
Does anyone know why this changed and if there is any technique to
allow updates of ad-hoc queries in a data grid involving multiple
tables?
Thanks Tag: Visual Database Tools and Oracle 9i Tag: 87247
Application Global Datasets
I am creating a dataset from xml on my main form using ReadXML. I have alot
of other forms and want to use data from the tables in the main forms
dataset. THIS IS NOT AN MDI APP. How can I set this up?
reference the main form then the data set?
put the dataset in its own class file?
use the dataset xsd (which I don't know how to do yet)?
something else I am not thinking of.
Obviously the entire point is to get the disconnected dataset into memory
and allow all my forms to hit the datables however they want. Also, since I
am creating the dataset from XML I dont think I can use most of the normal
wizards when doing this from server explorer.
Many thanks,
James M Tag: Visual Database Tools and Oracle 9i Tag: 87240
DataReader to ArrayList
Hi,
What would be the fastest way to transfer a one column DataReader into a
ArrayList ?
Thanks,
Alan Tag: Visual Database Tools and Oracle 9i Tag: 87223
Prob with Param in UpdateCommand
Greetings,
I'm trying to update a detail table which does not have
any unique fields (that is the exercise) and have a
problem with parameters in the Where clause, message says
my Where params not supplied. I have an int var and 2
string vars to retrieve the original values of the fields
in the row to be updated. If I don't use a where clause,
the params for the new values work OK except that all the
rows get the same values. Thus, I have to use a Where
clause but don't know to implement the Params in the Where
clause. Here is what I have so far:
sqlDA.UpdateCommand = New SqlCommand("Update tbl2 Set fld1
= @prm1, fld2 = @prm2 Where (ID = @ID And fld1 = @fld1 And
fld2 = @fld2)", conn)
-------------------------------------------------------
---params with new values---------this works OK without
Where clause----------
sqlParm = sqlDA.UpdateCommand.Parameters.Add(New
SqlParameter("@prm1", SqlDbType.VarChar, 50, "fld1"))
sqlParm = sqlDA.UpdateCommand.Parameters.Add(New
SqlParameter("@prm2", sqlDbType.VarChar,50, "fld2"))
-----------------------------------------------------
-----------------------------------------------------
---params for Where Clause with original values from
variables---------
---message says these params not being supplied to Where
clause''---------------
sqlParm = sqlDA.UpdateCommand.Parameters.Add(New
SqlParameter("@ID", SqlDbType.BigInt, 8, conID.ToString))
sqlParm = sqlDA.UpdateCommand.Parameters.Add(New
SqlParameter("@fld1", SqlDbType.VarChar, 50, strfld1))
sqlParm = sqlDA.UpdateCommand.Parameters.Add(New
SqlParameter("@fld2", SqlDbType.VarChar, 50, strfld2))
-----------------------------------------------------
Is there a way for me to reference the original field
values without using vars, conID, strfld1, strfld2? How
do I supply these params to the Where clause? Do I need
to do anything to conID.ToString - supposed to be an
Integer.
Thanks for help,
Jerry Tag: Visual Database Tools and Oracle 9i Tag: 87218
Data from Dataset into new table in SQL
Hello: I am having trouble creating a table and then taking the
contents of a dataset and insert it into the new table. I am looking
for methods and exsamples I have read many different approches.
1. I read my data into the dataset from a Text file. I do some
modifactions to the data.
2. I ask the user what table name they want. And then create the
table with the same fields that the text file has and the table name
that they specify.
3. I would like to take the data that is in the dataset and dump it
into the table that was just created. How would I do that?
Again, I have read many differnt ways with no success.
Please help. :) Tag: Visual Database Tools and Oracle 9i Tag: 87211
dataset share between 2 user controls
I have 2 user controls that both share the same typed dataset (which uses
the typical parent child relationship). The first control fills the dataset
and then passes a reference to it to the second control. There is a time
when the first control needs to update the data in the dataset and re-fills
it. However, when that is done, the second control does not "see" that
change as the pointers to the memory locations are now out of sync. Does
anyone know how to get it so that if my first control updates the dataset,
the pointers will remain the same, so that the second control can "see" the
new data? I tried creating a temporary dataset, filling it, and then
copying it to the original, but that didn't seem to work either. Any
thoughts would be greatly appreciated. Tag: Visual Database Tools and Oracle 9i Tag: 87205
Typed DataSet names - length restriction
Is there any restriction on the length of a DS name, Table name, Field
Name, number of tables, etc. in a Typed Dataset? Tag: Visual Database Tools and Oracle 9i Tag: 87203
Concurrency in ADO.NET
Hi all
We´re developing an application will have a lot of concurrent users. I want to know what´s he best way to give a solution to this problem in .NET. Any idea will be appreciated
Thanks a lot. Tag: Visual Database Tools and Oracle 9i Tag: 87190
sp_help_job (HELP)
Can anyone get sp_help_job to execute via ado.net ??
The following code produces a "severe error occurred on the command object"
SqlConnection connection = new SqlConnection(connectionString)
connection.Open()
SqlCommand cmd = new SqlCommand()
cmd.Connection = connection
cmd.CommandText = "exec msdb.dbo.sp_help_job @job_name='My SQL Job',@job_aspect='JOB'"
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandTimeout = 90
SqlDataAdapter da = new SqlDataAdapter(cmd)
DataSet ds = new DataSet()
da.Fill(ds)
connection.Close()
I can execute the same command Text in SQL Query Analyzer without a problem (using the same connection id and pwd)
Even if I don't pass any parms I get the error. I've tried to execute it as a proc and as text
Any ideas ?? Tag: Visual Database Tools and Oracle 9i Tag: 87186
connect to Access DB via IP address
Hi,
Like SQL Server, is it possible to build the connection string using IP
address for retrieving data from Access DB(.mdb) ?
Because I'm implementing an application in which the program installed on
retail shops which has boardband internet access, but the database is
located on Data Center, they have different subnet mask. So far I can think
of using VPN is the only solution to connect Access database in data center.
Thx in advance!
Keith Tag: Visual Database Tools and Oracle 9i Tag: 87185
Using only one connection for several forms with VS.NET
Hi,
I have several forms in my project now, each with it's separate connection
to a DB. I would like to have only one connection in a form or class that
can be used by all the other forms and still be able to use the VS wizards
for DataAdapter creation etc. I would also like to use the same DataAdapters
and DataSets accross multiple forms.
How can I do this most efficiently? Any good articles on this? I have not
found any good information about this on the web yet. Any tips, hints, links
or help will be greatly appreciated. Thanks in advance!
Cheers,
Trygve Tag: Visual Database Tools and Oracle 9i Tag: 87176
XML EXPLICIT
Hello,
I have a stored proc that takes two input params and returns xml using the "FOR XML EXPLICIT". I am at a loss how I can read this proc in .Net . I don't want to bind it or use a data grid etc, as its all on the server side. Does anyone know how to read a proc that returns XML ?
Regards
Danny Tag: Visual Database Tools and Oracle 9i Tag: 87171
Comparing two typed datasets
Hi,
I have a typed dataset for Employee named tdsEmployee.
tdsEmployee has two columns named FirstName, LastName
I want to compare two instances of tdsEmployee and get the differences.
For Ex:
tdsEmp1 might have data like
Row1: 'Mike', 'Meyers'
Row2: 'John', 'Doe'
tdsEmp2 might have data like
Row1: 'Mike', 'Meyers'
Row2: 'John', 'Abe'
Then after comparision, I want the result : 'John', 'Doe'
is there any way to do this ??
TIA. :) Tag: Visual Database Tools and Oracle 9i Tag: 87170
Connections as Static???
Hi
I am writing a fairly simple desktop app which will not be subject to great loads. Therefore this question is more for academic purposes
I have implemented a class that declares only static members and functions. I use this class to control my connections. There are just 2 methods; Open and Close. The connection object within the class is static and has public scope. It is created when the app is started. (This obviously enables connection pooling
This makes the code very simple. When I want to use a connection I just call myConnectionClass.Conn. No need to dimension anythinig, dispose etc. I just make sure I close it when the routine has finished
Is this OK? I am worried that by declaring just 1 connection as a static there will be threading issues. i.e. There may be a que of users waiting to use the single, shared connection object
What do you experts think
Andy Newland (MCAD) Tag: Visual Database Tools and Oracle 9i Tag: 87169
I'm stumped. We recently switched from Oracle 8i to Oracle 9i and now
I am unable to use the Visual Database Tools on them in Visual Studio