DataTable.Select with nested Parent fields
I want to make a selection from a DataTable using the Select method with the
criteria including a nested parent field. Both of these works fine
(Northwind data):
DataRow[] drs =
ds.Tables["OrderDetails"].Select("Parent(Orders2Details).ShipName LIKE
'A%'");
DataRow[] drs =
ds.Tables["Orders"].Select("Parent(Customers2Orders).CompanyName LIKE
'A%'");
But when I try to...
DataRow[] drs =
ds.Tables["OrderDetails"].Select("Parent(Orders2Details).Parent(Customers2Or
ders).CompanyName LIKE 'A%'");
...it doesn't work! I've looked everywhere without finding any clue on how
the syntax for a nested parent reference would look. Any input would be
appreciated! Tag: Change Font Size in the SQL pane using server explorer Tag: 80407
Merge doesn't merge
Perhaps I have the concept all wrong, but based on the documentation and
books I have read it seems this should work. I have multiple complex
datasets in an access db. They have 2 shared primary keys. I have another
dataset that shares one key with them. I need to end up with a single flat
dataset comprised of the merged sets. In a simpler world it would be a
normal sql join, but that is not an option.
Right now, I would love for someone to point out my stupidity and show me
the magic setting I have forgotten. An additional complication is that the
last dataset - the one with just one key was a "relation" issue because that
field in the other table was not unique values. It would be a many-to-one
relation.
I have tried using both the relation AND the merge to no avail. I am not
modifying this data. I just need to read it in, merge it based on the key
values, and kick it out as a single table. As a test I tried creating a more
simple 2 table set (in ms sql), read them into datasets, and tried to merge.
I just do not ever see a merged result. here is the code that goes with a
simple webform with one datagrid.
Dim ds1 As New DataSet()
Dim ds2 As New DataSet()
Dim da1 As New SqlDataAdapter()
Dim da2 As New SqlDataAdapter()
Dim cn As New SqlConnection()
cn.ConnectionString() = "server=daddy;database=test;uid=test;pwd=test"
cn.Open()
da1.SelectCommand = New SqlCommand("select * from table1", cn)
da1.Fill(ds1, "tbl1")
da2.SelectCommand = New SqlCommand("select * from table2", cn)
da2.Fill(ds1, "tbl2")
ds1.Merge(ds2, True, MissingSchemaAction.Add)
DataGrid1.DataSource = ds1
DataGrid1.DataBind() Tag: Change Font Size in the SQL pane using server explorer Tag: 80406
Column Expression question
Hello!
After filling table into DataSet (ds), I added following line ...
ds.Tables(0).Columns("MyColumn").Expression = "<MyFormula>"
... and calculation is working fine - but I need to save this calculated
field value into database also because it makes easier to make SELECT
queries later and it's quite often needed value in many cases too. This
"MyColumn" is as a field in database too, and is used too when making
DataAdapter in SELECT-query.
When trying to save, I'll get error message ...
"The column mapping from SourceColumn 'MyColumn' failed because the
DataColumn 'MyColumn' is a computed column."
Is it possible to save computed column values into database table at all?
--
Thanks in advance!
Mika Tag: Change Font Size in the SQL pane using server explorer Tag: 80403
SqlDataReader with no rows.
I am using a sqldatareader with this command:
select max(id) from x
If there is no rows in table x then using
sqldatareader.read() still return true as if
there is a row, which means this code breaks:
if (sqldatareader.read()) {
... = sqldatareader.GetInt32(0); // field 0 is null!?
}
All the examples i have seen on ms website and
in books dont take any precautions for empty
tables. Right now i am doing this:
if (sqldatareader.read() && !sqldatareader.IsDBNull(0)) {
... = sqldatareader.GetInt32(0);
}
It seems clumsy. I am doing somthing wrong here? Tag: Change Font Size in the SQL pane using server explorer Tag: 80395
Problem with OLE DB Provider
Hi,
I am working on an ASP.NET application. From a page, I am triggering export
of a large dataset into an Excel file using OLE DB Provider and after the
export is complete the user is redirected to the excel file. Note that the
operations here are synchronous. The problem is the data exported is not
getting written out to the disk before the user is redirected. So I get an
empty excel file in IE while if I check the actual file on the disk, the
data seems to be there after a lag of a few seconds.
From the KB article, I learnt I cannot set the Max Buffer Size property in
OLE DB cannot be set in ADO.NET. How do I ensure that the data is flushed to
the disk before I redirect the user to the file?
Thanks in advance,
Pranav Tag: Change Font Size in the SQL pane using server explorer Tag: 80390
Datagrid Column Width
I found the following code on microsoft.support.com which is supposed to with of a column
'----------------------------------------------
Dim ts As New DataGridTableStyle(
ts.MappingName = "tbl_Client
DataGrid1.TableStyles.Clear(
DataGrid1.TableStyles.Add(ts
DataGrid1.TableStyles("tbl_Client").GridColumnStyles("First_Name").Width = 17
'--------------------------------------------------------------------------------------
Where tbl_Client is the Table name and First_Name is the column Name
But when I run the code I get the following error
Object reference not set to an instance of an objec
Thanks for your hel Tag: Change Font Size in the SQL pane using server explorer Tag: 80389
PRINT in transact-SQL
Hi, I have a question regarding PRINT statement in transact-SQL.
The following is my test environment
* Vuisual Studion 2003, server explorer
* either in SQL pane or using stored procedur
The scenerio are like belo
* alter procedure myProcedure as PRINT 'HELLO' <===== It work
* alter procedure myProcedure as begin PRINT 'HELLO' end <===== It does not work
Please advice
Peter Tag: Change Font Size in the SQL pane using server explorer Tag: 80385
I Have No Identity
This has been addressed several times and I've read several articles and
posts and I still can't get this to work. (This is VB .NET)
My understanding is that if I append a select statement to my DataAdapter's
Insert statement that I should be able to get an updated resultset. I've
got this:
INSERT INTO dbo.FD_Files (FileName, ExpireTime, PostedBy, HashName,
FileSize, Description) VALUES (@FileName, @ExpireTime, @PostedBy, @HashName,
@FileSize, @Description); SELECT FileID, FileName, ExpireTime, PostedBy,
HashName, FileSize, Description FROM dbo.FD_Files WHERE FileID = @@IDENTITY
I've also tried using SCOPE_IDENTITY() - reagrdless, I always get the whole
table returned.
I need to know the identity of the record I just added and I keep getting a
whole table. It's making me crazy.
I've even tried setting the adapter's select command to SELECT FileID from
FD_Files WHERE FileID = SCOPE_IDENTITY() and re-filling the dataset. I get
the whole damned table. Why!!!!????
What am I missing? I've tried using the built in wizard which comes up with
an insert statement just like the one above and I still end up with the
whole table after I update.
Can anyone shed some light on this? Thanks.
Jerry Tag: Change Font Size in the SQL pane using server explorer Tag: 80384
Populate a DataTable (with Aggregation) from an existing DataTable
Hi,
I have a datatable with 2 keys columns, i need get this datatable with agregate totals.
How can i do that?
datatable
Key1 Key2 Total
1 1 100
1 1 200
1 2 50
1 2 10
2 1 100
i need other dattable agregate totals
key1 key2 Total
1 1 300
1 2 60
2 1 100 Tag: Change Font Size in the SQL pane using server explorer Tag: 80383
Calling Oracle date functions via ODBC and .NET
Hi! I'm using ODBC to connect to an Oracle database. I want to do
something like the following:
---------
var conn: OdbcConnection = new OdbcConnection("my connect string here");
var sql: String = "update mytable set col1=?, col2=? where keycol=?";
var command: OdbcCommand = new OdbcCommand(sql, conn);
command.Parameters.Add("@col1", OdbcType.Int, 22).Value = 1;
if (some_test) {
command.Parameters.Add("@col2", OdbcType.Date, 7).Value = 'SYSDATE';
} else {
command.Parameters.Add("@col2", OdbcType.Date, 7).Value = null;
}
command.Parameters.Add("@keycol", OdbcType.Int, 22).Value = my_key;
command.ExecuteNonQuery();
--------
My question is, how do I do that second parameter? How can I tell it to
call SYSDATE, or set the value to null? I admit that I haven't tried
this code, because I don't think that the string 'SYSDATE' is a valid
date object. Should it work?
Thanks,
Ricky Morse Tag: Change Font Size in the SQL pane using server explorer Tag: 80380
generic function to execute a sql stored procedure
hello,
In my asp.net projects I like to seperate the database connection and
lookups/executes from the code-behind pages using shared functions.
I find myself often using a function that returns a datatable given a
sql query and it works great. The function is contained in my
'dataaccess' class and is a shared function.
I would really like to do the same thing with stored procedures.
However, I'm running into problems handling the paramaters since there
can be zero or more and of varying types/names.
Ideally, the stored procedure's parameters can be defined in the
parameters of the function (using an array?) and then the stored
procedure is executed using the parameters within the function.
Does anyone have code for executing any stored procedure using a
generalized function? Is this even possible? Tag: Change Font Size in the SQL pane using server explorer Tag: 80379
Primary Key of string values (trims spaces from the end of strings) causes unique violation
I'm loading a key values into a database and two may be identical except for maybe 1 or 2 trailing spaces. This causes a unique constraint error because for some reason it's trimming the string values when checking the unique contstraint
I can clearly see in the dataset the string has spaces on the end. I know this is the exact problem because if I append a letter after one of them the exception goes away
Why does it trim the string when validating the Primary Key unique constraint
Thanks
Jeff Tag: Change Font Size in the SQL pane using server explorer Tag: 80377
Top SECRET of making huge money!!
Discovers the "Secret of making huge money" in just few weeks....
You shall be amazed that how easy 1 can make money on internet just for doing 1 time work..[I GUREENTED U CAN TOO MAKE BIG$$ WITH THIS PROGRAM]........
[Use IE if can't view the site]
http://mysiteinc.com/gohar/index.html Tag: Change Font Size in the SQL pane using server explorer Tag: 80376
Max Connection Pool Reached ...
Hi ,
" Timeout expired. The timeout period elapsed prior to obtaining a
connection
from the pool. This may have occurred because all pooled connections were in
use and max pool size was reached. "
I am getting this error in my application. All requests to the Database go
through the Data Access layer.
And I am opening and Closing connections in the Data Access Layer. I cant
seem to find out why this is still happening ?
The Server Classes that I have are a mix of ServicedComponents and
non-ServicedComponents and the Data Access Layer
as such is marked as TransactionOption.Supported. How would COM+ affect
pooling ?
Any tips/pointers on how for further diagnosis would be helpful.
Regards ,
Vikram Tag: Change Font Size in the SQL pane using server explorer Tag: 80367
No way to insert large data into oracle Clob???
Does anyone have the same problem?
I use follow code to insert a large xml into oracle database. The data is inserted, however shows as "¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿..
xmlRawDom.Load("D:\testActual.xml"
dataString = xmlRawDom.OuterXm
Dim AE As New System.Text.ASCIIEncodin
Dim ByteArray As Byte() = AE.GetBytes(dataString
rsConnection = DBClient.OpenDBConnection(_realSuiteDBString, True
tx = rsConnection.BeginTransactio
Dim rsCommand As New OracleClient.OracleComman
rsCommand = rsConnection.CreateCommand(
rsCommand.Transaction = t
rsCommand.CommandText = "declare xx Clob; begin dbms_lob.createtemporary(xx, false, 0); :tempClob := xx; end;
rsCommand.Parameters.Add(New OracleClient.OracleParameter("tempClob", OracleClient.OracleType.Clob)).Direction = ParameterDirection.Outpu
rsCommand.ExecuteNonQuery(
Dim tempLob As OracleLo
tempLob = rsCommand.Parameters(0).Valu
tempLob.BeginBatch(OracleLobOpenMode.ReadWrite
tempLob.Write(ByteArray, 0, ByteArray.Length
tempLob.EndBatch(
rsCommand.Parameters.Clear(
rsCommand.CommandText = "Realdata_Rxbdoc.InsertXMLtoQ
rsCommand.CommandType = CommandType.StoredProcedur
Dim oraparameter As New OracleClient.OracleParameter("strXML", OracleClient.OracleType.Clob
oraparameter.Direction = ParameterDirection.Inpu
oraparameter.SourceVersion = DataRowVersion.Origina
oraparameter.SourceColumn = "MSGDATA
oraparameter.Value = tempLo
rsCommand.Parameters.Add(oraparameter
rsCommand.ExecuteNonQuery(
tx.Commit(
rsConnection.Close(
********************
procedure
PROCEDURE InsertXMLtoQ(strXML IN CLOB ) A
BEGI
INSERT INTO ACTUALJOB (RXBDOC_ACTUALJOB_ID,MSGDATA) VALUES (1,strXML)
END
****************************
For small data, I can insert data directly like
'Dim conn As OracleConnection = New OracleConnection(_realSuiteDBString
'Dim cmd As OracleCommand = New OracleCommand("InsertXML", conn
'Dim s As FileStream = File.OpenRead("D:\rawActual.xml"
'Dim r As StreamReader = New StreamReader(s
'cmd.CommandType = CommandType.StoredProcedur
'cmd.Parameters.Add("strXML", OracleType.Clob
'cmd.Parameters(0).ParameterName = "strXML
'cmd.Parameters(0).Direction = ParameterDirection.Inpu
'cmd.Parameters(0).Size = r.BaseStream.Lengt
'cmd.Parameters(0).Value = r.ReadToEnd(
'conn.Open(
'Dim i As Int16 = cmd.ExecuteNonQuery(
'Console.WriteLine("{0} rows inserted", i
But for large data,this method give error:'ORA-01460: unimplemented or unreasonable conversion requested Tag: Change Font Size in the SQL pane using server explorer Tag: 80363
DataSet.Merge question
I have a dataset loaded with an xml that looks like this:
<associations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<association>
<associationid>{8a3aca06-a7de-41a5-b584-063e7cf391bb}</associationid>
<createdon>2004-02-17T12:05:40.3430000-05:00</createdon>
<modifiedon>2004-02-17T12:05:40.3430000-05:00</modifiedon>
<forwardrelation>Parent</forwardrelation>
<backrelation>Parent</backrelation>
<forwardnotes>ttt</forwardnotes>
<backnotes/>
<fromid name="" dsc=""
type="1">{8c4a969b-2aa4-4679-b170-d9f6441f7c6d}</fromid>
<toid name="" dsc="" type="2">{df3f306f-19de-4f50-9784-623bf6693fa8}</toid>
<createdby name="" dsc=""
type="8">{2479254f-1dee-41dc-b79b-8de686a4db29}</createdby>
<modifiedby name="" dsc=""
type="8">{2479254f-1dee-41dc-b79b-8de686a4db29}</modifiedby>
</association>
</associations>
Then I try to merge another dataset loaded with another xml:
<resultset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contact>
<contactid>{1323159A-E579-4A9B-95A2-5F9AFC041E28}</contactid>
<fullname>Jones, Sally</fullname>
<jobtitle>Lawyer</jobtitle>
<accountid name="Jones&Jones"
dsc="0">{EE22734B-F1A1-4B0F-B874-52FE2A3B1A6A}</accountid>
</contact>
<contact>
<contactid>{DF3F306F-19DE-4F50-9784-623BF6693FA8}</contactid>
<fullname>Dodd, Cindy</fullname>
<jobtitle>Owner</jobtitle>
<accountid name="Suburban Cycle Shop"
dsc="0">{D17A8F20-D1D0-4F51-B365-92FDF16EDBE9}</accountid>
</contact>
<contact>
<contactid>{54B82B18-D54D-4B6B-B114-73093D2A0070}</contactid>
<fullname>Hayes, Scott</fullname>
<jobtitle>Primary Owner</jobtitle>
<accountid name="A&M"
dsc="0">{3ABC2121-5315-4050-838D-477E04B37CE7}</accountid>
</contact>
<contact>
<contactid>{8929CAD1-E941-4B6E-AAB7-A3D3062A9C71}</contactid>
<fullname>Kennedy, Susan</fullname>
<jobtitle>Finance Workout</jobtitle>
<accountid name="A&M"
dsc="0">{3ABC2121-5315-4050-838D-477E04B37CE7}</accountid>
</contact>
<contact>
<contactid>{AADC8B14-27F3-4B03-8901-FC0929D48544}</contactid>
<fullname>Block, Larry</fullname>
<jobtitle>Sales Turnaround</jobtitle>
<accountid name="A&M"
dsc="0">{3ABC2121-5315-4050-838D-477E04B37CE7}</accountid>
</contact>
</resultset>
Using the following syntax:
associationDS.Merge(resultDS.Tables[0]); // assume the first xml has been
loaded into associationDS and the second into resultDS
There were no schemas involved and each DataSet is loaded via
ReadXml(XmlTextReader) method.
Things kind of work out ok as <contact> nodes are inserted right under
<associations> root so that it looks like:
<associations
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><association/><contact
/></assocations>
The only problem is that the resulting xml after the merge is missing
<accountid> node under <contact>.
What am I missing? Do I have to specify explicit schema info or
relationship - note that <association> and <contact> are seemingly
independant - ?
Thanks much!
Jiho Tag: Change Font Size in the SQL pane using server explorer Tag: 80361
Properties in VB = Parameters in .NET??
Hi!
I have this problem...
In Visual Basic I am work with ADODB and the next code work perfectly...
Dim cmd as New ADODB.Command
cmd.Properties(15).Value = 2
...
But in .NET..
OleDbCommand cmd = new OleDbCommand();
cmd.Parameters.add("15",2);
...
this code throws an error:
"An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll
Additional information: The ICommandWithParameters interface is not
supported by the 'GXPublic.GXPublic.3' provider. Command parameters are
unsupported with the current provider."
How I can work with properties en .NET?
thanks...
pablo Tag: Change Font Size in the SQL pane using server explorer Tag: 80357
Binding INTEGER and use of NULL
Hi
I bind a textbox to a field in the database through CurrencyManager. Everything works find exept one thing: I cannot type Null, blank, nothing in the textfield. The property in the database allows NULL but I cannot type blank in the textbox. Whatever I type that isn't numeric is changed then I leave the textbox
There must be an easy way to solve this - but what?
/Raymond Tag: Change Font Size in the SQL pane using server explorer Tag: 80355
Stored Procedure Syntax
Hi, I am attempting to updata a SQL Server record using the stored
procedure's UpdateCommand. Everything works fine if all fields are full,
but if a user clears out a textBox that originally contained a number in it,
then the update bombs out. The field in the table is setup to accept nulls.
What is the proper syntax to store it back?
da.UpdateCommand.Parameter[1].value = ???? <a null> ?????
Any help is greatly appreciated. Tag: Change Font Size in the SQL pane using server explorer Tag: 80354
DB_SEC_E_AUTH_FAILED(0x80040E4D).
Hallo
I have an import process that crashes after importing millions of data rows suddenly stops working with the error message
System.Data.OleDb.OleDbException: No error information available: DB_SEC_E_AUTH_FAILED(0x80040E4D)
The exception coccurs when making the connection to the Access 2000 databas
objConnection.Open(
Has anyone had this kind of error before
As next I was going to check if this could be related to MDAC or if there is a problem with the sharing of the database connection.
Any ideas would be welcome..
Thanks..
Nigel... Tag: Change Font Size in the SQL pane using server explorer Tag: 80353
Isolation Level
Hi,
We have an Asp.Net applcation with Sql Server as back end. I have a
base class function that takes a SqlCommand Object as a parameter and
returns a datatable. I want to set the Isolation to "Read Uncommited" (Sql
Server's default Isolation Level is "Read Commited") as I am just selecting
some data from the tables. When I try to do the following :
objSqlCommand.Transaction.IsolationLevel = IsolationLevel.ReadUncommitted
The system says IsolationLevel is a Readonly property.
So the only option that I have currently is to set the Isolation Level to
"Read Uncommitted" in the Stored Procedures.
Is there a way to set it in the code so that I don't have to set it for each
stored procedure.
Thanks a lot. Tag: Change Font Size in the SQL pane using server explorer Tag: 80350
Does SqlHelper automatically close SQL connection?
Suppose I want to do something like populate a droplist control with
some data. I want to use as few lines of code as possible. In the
examples for the Microsoft Application Data block, it shows a few ways
of doing this.
(Note that Global.GetSqlDataSource(string) returns a SQL connection
string like this: "server=sqlserver.domain.com; uid=login;
password=pass")
CASE A:
// Execute stored procedure to load list of data labels
DataSet ds = SqlHelper.ExecuteDataset
(Global.GetSqlDataSource("DATA"),
CommandType.StoredProcedure, "usp_DataLabels_List");
dropDataLabels.DataSource = ds;
dropDataLabels.DataBind();
In case A, how does the SQL connection get closed? Does the connection
get closed after the dataset is assigned to ds? Or do I have to add
something? What would I need to add?
CASE B:
// Execute stored procedure to load list of data labels
dropDataLabels.DataSource =
SqlHelper.ExecuteReader(Global.GetSqlDataSource("DATA"),
CommandType.StoredProcedure,
"usp_DataLabels_List");
dropDataLabels.DataBind();
In this scenario, where is the connection closed? Or does it create a
leak?
If I want to keep code minimal, should I make an object that inherits
from SqlHelper, but calls this.Close() when it is finalized? Or do I
need to write more code to allocate a connection seperately and then
close it. Doesn't that defeat the purpose of the SqlHelper?
Thank you very much!
David
Meet people for friendship, contacts,
or romance using free instant messaging software! See a picture you
like? Click once for a private conversation with that person!
www.SEN.us
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Change Font Size in the SQL pane using server explorer Tag: 80347
Connection recovery problem with OracleConnection
Hi,
I'm using ADO.Net C# with Oracle9i Release 9.2.0.4.0
when loosing the connection with the Oracle database server the connections
doesn't recover and always returning the following exception even when the
connection has been restore:
"ORA-03114: not connected to ORACLE". I'm closing the connection properly in
that it will return to the connection pool. Here is an example code:
using(OracleConnection conn = new OracleConnection(connectionString))
{
conn.Open();
using(OracleCommand cmd = new OracleCommand(sql, conn))
{
object obj = cmd.ExecuteScalar();
}
}
This should close the connection properly. In the MSDN it is mention that if
the connection pooler detect that the connection with the server has been
severed it will remove the connection from the connection pool. It appears
that this is not happening an I always get bad connections from the pool,
even after the connection with the database server has been restore. How can
I solve this? What is the proper way to recover from connection lost with
database server?
Thanks,
Michael. Tag: Change Font Size in the SQL pane using server explorer Tag: 80343
adodb.connection problems
Hello,
I am having a problem with ADODB connection class. This was all working fine until I restarted the pc with last known good configuration, which seems to have screwed things up
In the code below the conn.open command fails with a "cannot find stored procedure error". and system.runtime.interopservices.COMexception. The specified procedure could not be found. at ADODB.ConnectionClass.Open etc.. How can I fix this problem, do I need to re-install anything. I still have a reference to adodb
Regard
Robert
Dim Conn As ADODB.Connection = New ADODB.Connectio
GblConnectionString = "PROVIDER=SQLOLEDB.1;PASSWORD=" & txtPassword.Text & ";PERSIST SECURITY INFO=TRUE;USER ID=" & txtLoginName.Text & ";INITIAL CATALOG=Master" & ";DATA SOURCE=" & txtServerName.Tex
Tr
Conn.Open(GblConnectionString) '''*********** FAILS HERE*******************
Catch e As Exceptio
MsgBox(e.Message
MsgBox(e.ToString
End Tr
Dim rs As ADODB.Recordset = New ADODB.Recordse
Dim strRowSource As Strin
Tr
rs.Open("SELECT Name From sysdatabases WHERE Name NOT IN( 'master','tempdb','model','msdb','pubs','NorthWind')", Conn
Catch e As Exceptio
MsgBox(e.Message
MsgBox(e.ToString
MsgBox(e.Source
End Tr Tag: Change Font Size in the SQL pane using server explorer Tag: 80339
Refreshing database cache
Dear all
I have written a windows service that connects to an Oracle 9 database on
start up. I use a DataTable to hold a set of near static data.
Recently there have been some overnight external batch updates to this table
and my DataTable needs to be refreshed. Since this change of circumstances I
have been restarting my service in the morning. I need to find a way to
fresh my data object without restarting the windows service. I would be
grateful for any pointers.
Regards,
Wazir Tag: Change Font Size in the SQL pane using server explorer Tag: 80337
Array as input parameter
Hi all,
I need a SQL stored procedure that has an input parameter of type array of
datetimes.
How to define such a procedure? if possible
Thanks, Tag: Change Font Size in the SQL pane using server explorer Tag: 80330
need suggestion in Guid autogeneration in dataset
Hi al
I have PK with Guid type in typed dataset
Is anybody have any suggestion how 2 implement autogeneration of P
thnks Tag: Change Font Size in the SQL pane using server explorer Tag: 80326
System.Data.OracleClient
Couldn't understand why following line of code is failing
<%@ Import namespace="System.Data.OracleClient" %
I am getting following error
BC30466: Namespace or type 'OracleClient' for the Imports 'System.Data.OracleClient' cannot be foun
Although I can see the System.Data.OracleClient in References and I have v1.1 framework installed. Tag: Change Font Size in the SQL pane using server explorer Tag: 80325
Timeout Expired error.
Hi there!
I am using MSDE 2000 SP3, Sql.Net provider on Win2k server. When I try
to execute very simple query of inserting/selecting a row into a
table, I am getting following error,
"Timeout expired. The timeout period elapsed prior to completion of
the operation or the server is not responding."
This behaviour is not consistent. I have checked my code for not
leaving any connection open. Is there any limitation on number of
connections on MSDE? Or is it a problem with Sql.Net provider? Please
help me.
Thanks in advance. Tag: Change Font Size in the SQL pane using server explorer Tag: 80324
FoxPro connect problems REGDB_E_CLASSNOTREG
I'm using vs.net, clr 1.1, c# web application. I get the following error
connecting to foxpro using its oledb driver. I've tried several ways to
connect.
No error information available: REGDB_E_CLASSNOTREG(0x80040154).
[OleDbException (0x80040154): No error information available:
REGDB_E_CLASSNOTREG(0x80040154).]
[InvalidOperationException: The 'vfpoledb.1' provider is not registered
on the local machine.]
System.Data.OleDb.OleDbConnection.CreateProviderError(Int32 hr)
System.Data.OleDb.OleDbConnection.CreateProvider(OleDbConnectionString
constr)
System.Data.OleDb.OleDbConnection.Open()
Elkhorn.eCatData.Page_Load(Object sender, EventArgs e) in
j:\projects\aproject\aproject\webui\data.aspx.cs:45
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
I downloaded and installed the driver foxpro8 driver from:
http://www.microsoft.com/downloads/details.aspx?familyid=0f43eb58-7a94-4ae1-a59e-965869cb3bc9&displaylang=en
I don't have any verison of foxprox on the machine. I registered
vfpoledb.dll myself from the command line just to make sure.
The connection tested ok with the "Test Connection" button when I used
the designer.
I think the connection string is fine, is as on connectionstrings.com.
@"Provider=vfpoledb.1;Data
Source=C:\progra~1\aproject\data\data1.dbc;Password=;Collating
Sequence=machine";
Any ideas?
??? Tag: Change Font Size in the SQL pane using server explorer Tag: 80320
Concurrency violation, I don't understand!
[This followup was posted to microsoft.public.dotnet.framework.adonet and a copy was sent to the cited author.]
Hello everybody.
I have a problem with an exception when I try to modify a row in a mssql
db. The exception that I found is Concurrency violation.
I read some other posts but I didn't find a solution.
In effect with my code I want to replace all the strings inside a
"info" attribute with the word "Hello" (This is a test, I know that this
is a stupid thing, but I wanna make that). My code update 212 row but
give me a concurrency violation in 7 roes. All these 219 rows are
selected at the same time e stored inside the same table.
The rows that I can't update are like the following:
"IST. DI CLIN. CHIR. GEN. E TERAPIA CHIR. PROF.BATTEZZATI"
But if I use SQL to replace this string with another one shorter
(Like
"IST. DI CLIN. CHIR. GEN. E TERAPIA PROF.BATTEZZATI"
or
"IST DI CLIN CHIR GEN E TERAPIA CHIR PROF BATTEZZATI"
)
and then I run my code, it works fine and this line is replaced by the
"Hello" word.
In the db the info attribute is a nvarchar(90), I don't understand where
is the problem. Is there some limit in the dimension of string that can
be inserted in a datarow or datatable object?
Thanks to everybody Tag: Change Font Size in the SQL pane using server explorer Tag: 80318
Stored procs to xsd example
I have 3 pre-built stored procs and want to load the results of them
into an xsd for processing.
I've defined the XSD with different table and column names and would
like to map these to each of the procs. I can change the names if
necessary, but would rather map it, if for no other reason than to learn
how to
Does anyone have an example of how to do all this, or a link to an
article for it?
Thanks
Tim Almond Tag: Change Font Size in the SQL pane using server explorer Tag: 80317
dataset.getchanges fails to return changes
Hi All
I'm experiencing the problem of dataset.getchanges
returning unmodified rows only :
myDs.ReadXml("c:\Parsley.xml", xmlReadMode.Auto)
For Each t In myDs.Tables
For Each r In t.Rows
If r.Item("Deleted").ToString = "True" Then
r.Delete()
Exit For
End If
Next r
Next t
myTmpDs = myDs.GetChanges()
myDs.Merge(myTmpDs)
myDs.WriteXml("c:\Parsley.xml", xmlWriteMode.WriteSchema)
The getchanges call returns the non deleted rows, the
merge call adds these rows to the main dataset. I have
read elsewhere that I need a primary key? There is one on
the SQL table the xml is extracted from but nothing in the
xml to indicate this.
Ta v'ry much
Parsley Tag: Change Font Size in the SQL pane using server explorer Tag: 80314
Installation Failure of MDAC 2.1 on Windows Server 2003
Hi, all,
I have an application that starts installing with MDAC 2.1. Once the MDAC
2.1 is installed, it reboots the server and then continues again with the
installation process once reboot complete. But then again, MDAC 2.1 is
installed for the second time, it goes on like this. If I choose Cancel, the
installation process has to abort. I understand that the version of MDAC on
windows 2003 is at least 2.8. But how can I also install MDAC 2.1 for some
application compatibility?
Thanks a lot,
Jake Tag: Change Font Size in the SQL pane using server explorer Tag: 80311
Oracle Connection Pool Performance
We are troubleshooting performance problems with our application.
There are 30-50 users using an web IE OLTP application against a 3-6GB
database, queries often hitting several tables (40,000-1.2M rows but
using indexes) foreign key constraints enabled). The architecture is
ASP.NET - DOT NET 1.1 which means a connection pool using OLEDB.
There are issues with DataReaders not being closed - meaning new
connections opening often - sometimes we see 90-120 open connections.
The clustered dual server is fairly new with a fast dual cpu, INTEL,
WIN2000 server over 9 disks, mostly Raid 5. However there is 1.5GB
RAM and little disk I/O activity. Perhaps the issue lies in the SQL,
lack of caching and connection pool. However there are no queries
with huge buffer gets and the oracle stats do not point to anything
specific.
Are there inefficiencies with dot net 1.0 with Oracle and many users?
Any ideas on next steps - Metalink does not have much that is NT
specific.
Final info Database is 8.0.5 and no not an option to upgrade that yet,
perhaps in 6 months but the issues are here and now :-) Tag: Change Font Size in the SQL pane using server explorer Tag: 80307
Configure DataAdapter Changes the Name of a Column in Insert Command
I have a SQLDataAdapter that I allow the Configuration Wizard to auto-configure the Select, Insert and Delete commands. During the configuration wizard the Select Statement that I cause to be created is simple: SELECT [ICD-9], Category, Description FROM [ICD-9] ORDER BY [ICD-9].
However, the Insert statement that is created is : INSERT INTO [ICD-9] ([ICD-9], Category, Description) VALUES (@Param1, @Category, @Description);
Look at the VALUES. Instead of the first parameter being @ICD_9, it's changed to @Param1. Now believe it or not, the statement works OK but I have no idea where @Param1 comes from and I certainly don't set a value for @Param1.
Why did the configuration wizard change the name of the first column to @Param1 instead of using the @ICD_9 the way that I expected. Is it that pesky hyphen in the column name that I never should have placed in a column name in the first place? Tag: Change Font Size in the SQL pane using server explorer Tag: 80300
Calculated Columns vs Calculations in stored procs.... what is the best way ???
I have several crossTab type reports in a VB app.
I am displaying these reports in a Datagrid. The Datagrid gets its
data directly from a stored proc I have created on SQL Server 2000
(rp_crossTab) which returns data in a nice crossTab fashion. (The
stored proc accepts parameters such as onRows, onCol, sumBy, etc.)
My problem is I have several crossTab reports which actually depend on
data found in other crossTabs.
For example, I have this total paid amount crossTab:
REPORTA
Name/Month Jan Feb Mar
Jon 20 40 40
Jack 100 50 200
Jill 25 75 75
And another report might be a month-to-month ratio of the total paid
amount:
(this report clearly depends on REPORTA)
REPORTB
Name Jan to Feb Feb to Mar
Jon 2 1
Jack 0.5 4
Jill 3 1
I thought of two ways to create REPORTB:
1) Call another stored proc which then calls rp_CrossTab, and performs
the necessary calculations using tempTables.
2) Creating a new table using new DataColumn objects in .NET and
setting their necessary values in the "Expression" field (eg
"Jan/Feb") and also making the columns dependent on REPORTA.
I can think of various problems with both scenarios...
Correct me if I am wrong but solution 1 would take a huge performance
hit since it would be in fact re-calculating REPORT A in order to
generate REPORT B.
Solution 2 sucks because I would have to hard-code logic in my .NET
app and I dont really wanna do that.... as well I dont think I can use
custom functions in the column Expression field (eg.
DataColumn.Expression = "MyWeightedAverage(COL1,COL2,COL3)")
What is the best way to create this second (or any other dependent)
report?
Is there something I have missed?
Is it generally better to have ALL logic in stored procs... even it is
much slower?
Thanks a lot, I really appreciate any comments anyone may have. Tag: Change Font Size in the SQL pane using server explorer Tag: 80299
19 Feb 2004, How to access VB.net applications thr' PDA's
Hello,
I recently started development in Vb.net. I am about to finish a product in
VB.net Database Applicatio, Sql Server as Backend.
I read little about wireless technology and PDAs.
Is it true that one can access VB.net forms/applications running on Server,
using PDAs ?
If so please tell me where to start for this ? what is the infrastructure
investment for such projects ? What are running cost in terms of hardware
and software ? Where can I get more resources on this topics ?
Thanks in Advance.
Regards.
[Sham Shrinivas Yemul]
--
> > Visit following web site for Colored flame lamps
> >http://in.geocities.com/osyemul/index.html
***********************************************
Intellisoft Computer Consultants Pvt. Ltd.
340 A Sakhar peth, Solapur - 413005
Phone : 91-(0)217-262 4713
http:\\intellisoft.netfirms.com
Email : yemul@fusemail.com
*********************************************** Tag: Change Font Size in the SQL pane using server explorer Tag: 80298
OleDbDataAdapter appears to use incorrect path to DB
Hi
I am using .NET framework 1.0. I am having problems with the following
VB.NET code:
----
.
.
.
.
Dim da As New OleDbDataAdapter(selectQuery, connection)
Dim ds As New DataSet()
Try
da.Fill(ds)
Catch eDB As OleDbException
showException("Database exception while filling dataset.", eDB)
Return Nothing
End Try
.
.
.
-----
The connection object i pass into the OleDbDataAdapter constructor has been
initialised with the connection string:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=x:\projects\TestData
\tracking.mdb;User ID=Admin;Password=;Mode=Share Deny None"
I checked that the data adapter's SelectCommand's connection was set to the
correct connection string using the debugger.
On the line: da.Fill(ds), i get an exception with the message:
"Could not find file 'x:\projects\MyAppName\bin\tracking.mdb'."
Now, obviously this occurs because the database does not exist at this
location. But what I can't understand is why the path it's using to look
for the database is the executable path.
Has anyone seen this issue?
Any help/comments greatly appreciated!
Thanks
id Tag: Change Font Size in the SQL pane using server explorer Tag: 80295
Deleting In Strongly typed Dataset
Hi All!
After a long time for trying understand how strongly typed dataser
work, I've finaly success. Except on the delete command. When I do some
deleting, it only delete record from the dataset but not from the database.
I've try many thing but I turn arround. I paste you the code I use.
Me.cnAlbums.Open()
Dim Row As DsAlbums.PhotoRow =
Me.DsAlbums.Photo.FindByPhotoId(CInt(Me.lblPhotoId.Text))
Me.DsAlbums.Photo.RemovePhotoRow(Row)
Me.UpdateFlag = False
Me.DaPhoto.Update(Me.DsAlbums, "Photo") ' There is where it's suppose to
delete..?
Me.UpdateFlag = True
Me.cnAlbums.Close()
Sorry for my english but I'm french and I didn't get any response on the
french newsgroup
Thank a lot,
Francois Tag: Change Font Size in the SQL pane using server explorer Tag: 80294
form controls for relational tables with one-to-one correspondence
Hi,
What form controls should I use to manage the data thats in relational
tables. Each relTable may have no row OR one row corresponding to the
row in master table. Probably this is more of a database design
question than programming logic. Tag: Change Font Size in the SQL pane using server explorer Tag: 80292
GetChanges from a DataTable into a DataSet???
Is there a good way to get the changes only from a single datatable.
I am using a typed dataset that holds four tables. I would like to
get the changes only from one of them. If I use the
ds."mytable".GetChanges it returns an instance of the datatable. Is
there a good way to get that table into an empty instance of the
dataset?? The ds."mytable" is read only. The best way I have found
is to get all the changes ds.GetChanges and then to clear the rows of
the other tables. I was hoping there was a better way. Basically
because of business rules I want all of these tables in the same
dataset but this one particular table has its own update statement.
Thanks for any help on the matter.
AJL Tag: Change Font Size in the SQL pane using server explorer Tag: 80290
please help... multiple key table and merge
I have a table with 3 keys, it is possible that the user may want to
change one of them. If the key is changed (let's say from 1 to 2) the
actual update to the database works fine. The problem is that when
the dataset gets back to the client and an attempt is made to merge
with the original dataset, an error is thrown:
"Failed to enable constraints. One or more rows contain values
violating non-null, unique, or foreign-key constraints."
Basically, the original data appears to assume the original key value
is 2 when it is really 1. It seems to me that I should be able to do
this. The row is in a modified state so the 2 value should not be
considered the current key. Any suggestions would be greatly
appreciated.
Aaron Tag: Change Font Size in the SQL pane using server explorer Tag: 80289
Difference between MissingSchemaAction and FillSchema?
I just read that the setting the DataAdapter's MissingSchemaAction
property to AddWithKey will set the primary key, MaxLength and
AllowDbNull.
I also read that FillSchema will set the primary key, MaxLength,
AllowDbNull and AutoIncrement. Is it correct that AddWithKey will not
set the AutoIncrement property of a column but FillSchema will?
--
Bill Tag: Change Font Size in the SQL pane using server explorer Tag: 80282
How To Encrypt a connection String
Hi,
I store my connection string into a .config file
How can I encrypt this file or the connection string ?
Stan Tag: Change Font Size in the SQL pane using server explorer Tag: 80281
Oracle Provider - ora-1031 error
I have an ASP.NET application written using VS.NET 2003 that uses
Microsoft's Oracle provider. I'm getting an occasional error, ORA-1031
insufficient privileges. It normally happens when the users add a record
but it has happened a couple times when they update a record. I know the
users have proper rights set up because they add and update records all day
long. The error pops up only once or twice a day.
I'm assuming that insufficient privileges means that the user was able to
log in successfully but then tried to do something that they didn't have
permission to do. If they tried to log in with an incorrect user name or
password, they would get a different error. Does this make sense? I ask
because I store the user name in a session variable and I was wondering if
that was somehow getting cleared before the they attempted to login. If
that were happening I wouldn't think that it would be an insufficient
privileges error.
Does anyone have any ideas why this error would be popping up every once in
a while? Some sort of timeout issue? Suggestions?
Thanks
Terry Tag: Change Font Size in the SQL pane using server explorer Tag: 80277
Looking for documentation on the inner workings of dataset/datatable/datarow...
Hi, I'm trying to make some customized versions of these tools.
The typed datasets are a step in the right direction but I'd like to add
some core functionality in the form of..
MyTable/Row/DatasetBase
Inherits DataTable/DataRow/DataSet etc....
...add some functionality...
MyCustomDataObject
Inherits MyBaseClass
...add custom properties and so on....
Anyway, where I'm having trouble is finding complete documentation on the
involved classes.. When you look over the code for typed datasets you find
various interesting and undocumented functions such as DataRowBuilders and
other constructors and such that aren't documented..
Does anyone know where I can find out about these things? I'd be thrilled
if there was a book I could hunt down, but even a web article would help..
I could probably fake it, and copy enough of the structure from a generated
typed dataset to get things moving, but I'm not comfortable having the
entire core of my work be based on things I don't even fully understand....
Any suggestions??
W.G. Rowland Tag: Change Font Size in the SQL pane using server explorer Tag: 80274
asp.net app does not work on 1.1 framework on production box
I am having an issue with an asp.net website not working in production
on the 1.1 framework, yet it works in development on the 1.1
framework. Both production and development are pointing to the same
database server. I get the error below:
Error: {0}System.Data.SqlClient.SqlException: SQL Server does not
exist or access denied. at
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString
options, Boolean& isInTransaction) at
System.Data.SqlClient.SqlConnection.Open() at
CollectorPerformance.menu.isSpecialAccessUser()An error has occurred.
Please contact the Help Desk.
Thanks for any ideas! Tag: Change Font Size in the SQL pane using server explorer Tag: 80265
DataTable Column question
Hello!
I add column into DataTable after table is filled into DataSet like ...
ds.Tables("WorkQueue").Columns.Add("OpenQty", GetType(Integer),
"OrderedQty-PreparedQty")
This column will be the last one, but how can I place it just after
'OrderedQty' 'PreparedQty' columns, because then it's not the last column?
Is this even possible?
--
Thanks in advance!
Mika Tag: Change Font Size in the SQL pane using server explorer Tag: 80264
ADO.NET convert NULL to default value?
I'm working on a J++ conversion, and with the older ADO and the Java
WFC, we have methods like GetInt and GetString on Field classes that, by
default, convert NULLs to a default value.
J# -> .NET forces us into ADO.NET, and suddenly all these calls to Field
classes explode with a ClassCastException if the value is NULL -- no
conversion to a default value occurs.
I've mentioned this to a couple of people on weird occasions, and both
have mumbled something about being able to set something to change this
behavior. Is there such an option in ADO.NET?
--
Chris
http://clabs.org Tag: Change Font Size in the SQL pane using server explorer Tag: 80262
Hi, please advise how to change teh font size in the SQL pane when using the server explorer.
Peter