|
Hey, I think I found the article you mean. It didn't really apply to me since I'm not using the command builder, but it did point me in the right direction - I had to call GetChanges or else it wouldn't let me update at all (even though I know for a fact that the records couldn't have been changed). Still calling GetChanges (or refilling the dataset, my original tactic but an expensive one) makes the exception go away.
|
|
|
|
|
This may or may not relate to you situation, but I got the same exception when I had the wrong number of parameters added to my Update command using the OleDbDataAdapter. If you remove fields from the CommandText, but don't remove the related parameter from the commands ParameterCollection, it'll throw this exception for some strange reason. I would have thought it would just ignore the extra parameters, but it doesn't.
|
|
|
|
|
Thanks for your reply. I solved the problem - I just had to call GetChanges and get a new set before it would let me update. There are certainly a lot of quirks in this system! I'll keep your tip in mind if I get that error again - I can't imagine what you must have gone through to work it out.
|
|
|
|
|
I have a batch file where I am put a file into ftp site. The problem is that my file name are changing every day. How do I supply this file into batch file?
Or is any other way to do this?
open ftp.site
user test
pass test
lcd C:\
cd ..
put test.txt
bye
|
|
|
|
|
There are a couple of possible solutions:
1. Create a simple program that creates a fresh FTP script each day. Example BAT file:
@echo off<br />
echo open ftp.site > myftpscript.txt<br />
echo user test >> myftpscript.txt<br />
echo etc >> myftpscript.txt<br />
echo put %%1 >> myftpscript.txt<br />
echo bye >> myftpscript.txt<br />
ftp -n -s:myftpscript.txt
2. Use "mput *.txt" instead of "put test.txt" to transfer all matching files from your source directory.
Hope this helps.
Andy
PS: This was probably the wrong forum to post this question to.
|
|
|
|
|
anyone knows where can I get a Beta version of this enterprise server??!!
nevhile.net
|
|
|
|
|
There's a very small beta program at the moment; the SQL Server team normally does three betas, at 100, 1000 and 5000 customer sites.
Beg nicely at http://www.betaplace.com/[^].
Bear in mind that the CLR functionality (writing stored procedures and functions in .NET languages) is yet to be fully set in stone.
If you go along to the PDC[^] there might be a hand-out of Yukon beta code.
|
|
|
|
|
Hello folks, I have been traversing the net for information on this particular thing I want to have happen:
1. Execute a FROM XML EXPLICIT SQL Server 2000 query to get an XML document, which lists users per role, eg.
<Role role_id="1" role_name="administrator">
<User user_id="1" user_login="admin"/>
<User user_id="2" user_login="drikusr"/>
</Role>
2. This result is read into a Dataset (C#), eg.
objXMLReader = (XmlTextReader)objCommand.ExecuteXmlReader();
objDataSet.ReadXml(objXMLReader, XmlReadMode.InferSchema);
3.I seem able to easily manipulate the dataset when employing the following code:
strXmlDocument = (objDataSet.GetXml());
this.xmlObject.Document.LoadXml(strXmlDocument); Which enables the XML document to be read into a string variable, ie. strXmlDocument
On the other hand, synchronizing the Dataset with an XMLDataDocument, eg.
xmlDoc = new XmlDataDocument(objDataSet); and loading a transformation, eg.
XslTransform xslTran = new XslTransform();
xslTran.Load(xsltPath);
upon which the following code is executed:
stringWriter = new StringWriter();
xmlWriter = new XmlTextWriter(stringWriter);
xmlWriter.Formatting = Formatting.Indented;
xmlWriter.Indentation = 2;
xslTran.Transform(xmlDoc,null,xmlWriter,null);
this.txtFormattedXML.Text = stringWriter.ToString();
stringWriter.Close();
xmlWriter.Close();
returns an XSLT processed XML document, but with the actual data missing, which was read from the database.
For example:
The first set of commands produce this XML document that has the Role data included:
<?xml version='1.0' encoding='utf-8'?>
<NewDataSet><Role role_id="1" role_name="administrator">
<User user_id="1" user_login="admin"></User>
<User user_id="2" user_login="drikusr"></User>
</Role></NewDataSet>
The XMLDataDocument and XSLT transform (with missing data) results in:
<html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<head>
<link rel="stylesheet" href="css_stylesheets/netLc_Styles.css" />
</head>
<body>
</body>
</html>
Has anyone done an end-to-end FOR XML EXPLICIT to ADO.Net solution and hence manipulated the XML (all in memory) displaying it on the UI and getting back changes which are written to the Database by ADO.Net?
All the examples on the net keep stuffing around with XML documents located on the file system and every single "FOR XML EXPLICIT" and ADO.Net example (usually the same one re-hashed on different sites ) stop short at the Dataset, with no client rendering.
As you might be able to tell, I don't have a lot of .Net experience, so I may be overlooking the obvious.
Your help is appreciated!
Regards
Drikus
|
|
|
|
|
Well, I sort of got this resolved. After reading volumes on the synchronisation of the Dataset and XMLDataDocument (andapplying XSLT, for an SQL Server FOR XML EXPLICIT query), I have conluded that the XMLDataDocument is not the way to go.
Instead, after executing the stored porcedure (which gets the Explicit XML result), eg.
objXMLReader = (XmlTextReader)objCommand.ExecuteXmlReader();
and reading the result into a Dataset, eg.
objDataSet.ReadXml(objXMLReader, XmlReadMode.InferSchema);
rather create an XPathDocument, eg.
myXPathDocument = new XPathDocument(objXMLReader, XmlSpace.Preserve);
and load the XSLT transformation, eg.
XslTransform xslTran = new XslTransform();
xslTran.Load(xsltPath);
then perfrom the transformation and output both the HTML result, as well as the HTML code to web objects for display, eg.
stringWriter = new StringWriter();
XmlTextWriter writer = new XmlTextWriter(stringWriter);
writer.Formatting = Formatting.Indented;
writer.Indentation = 2;
writer.QuoteChar = '\'';
xslTran.Transform(myXPathDocument,null,writer,null);
writer.Close();
this.txtFormattedXML.Text = stringWriter.ToString();
this.lblHTMLOutput.Text = stringWriter.ToString();
The quest has but begun...
|
|
|
|
|
In nutshell, there is DataTable within DataSet. One of DataTable's columns is expression-based. Afer I tried to update database (via use DataAdapter.Update(DataTable)), following exception occured:
An unhandled exception of type 'System.Data.VersionNotFoundException' occurred in system.data.dll
Additional information: There is no Original data to access.
HELP!
|
|
|
|
|
Try writing yourself the Update command for the DataAdapter, omitting the calculated column...
Free your mind...
|
|
|
|
|
|
Hi,
Environment of web application is: Windows 2000/VB.NET/ASP.NET/SQL 2000
I am passing an XML to the sproc and reading it using OPENXML. There is a date value coming as one of the parameters. Sometimes, the date can be blank.
Now how can I use CASE..END in WITH section to decide, if its a blank then use NULL else pass the incoming date? See the following scenario.
Select *
from OPENXML (@idoc,'/TaskDetail',1)
with
(
ClosedDate smalldatetime 'ClosedDate',
)
Please advice.
Thanks
Pankaj
Follow your goals, Means will follow you ---Gandhi---
|
|
|
|
|
I have a c# application that does frequent checks to the database to see if a status flag in a table has changed.
After the query, I close the connection and command objects with
connection.Close() and
command.Dispose()
If I look at the current activity in SQL Server, I see each of these queries as sleeping processes that just continue to accumulate. What am I missing that keeps these processes around after the query completes?
If it makes a difference, I am using MSDE.
Thanks in advance,
Bruce
|
|
|
|
|
Hi!
I am using sql server 2000. How do I make my DB case sensitive without reinstalling sql server 2k?
Please help me on this.
"To teach is to learn twice"
|
|
|
|
|
Reinstalling won't help. You bought the wrong product. You should have purchased SQL Server 2K.
|
|
|
|
|
If you just want to change a single database, you need to run an ALTER DATABASE query, e.g.
ALTER DATABASE mydb
COLLATE SQL_Latin1_General_CS_AS This only alters the new default and how object names are interpreted; you'll need to alter any existing tables as well.
If you need to change the default collation of the database server (including the tempdb database), you should run the rebuildm tool. See also KB article 273572[^] about a problem with this tool when the source files are read-only. rebuildm lives in the 80\Tools\binn directory under the SQL Server install directory.
Note that rebuildm and setup use 'friendly' names for the collations, whereas Enterprise Manager and queries use a different naming convention. The names used in setup are listed in Selecting a SQL Collation[^], while the names used in queries may be found under SQL Collation Names[^].
There are two types of collations: those implemented using the Windows national language support functions (Windows collations) and those implemented independently by SQL Server (SQL collations). SQL collations have names beginning SQL .
|
|
|
|
|
I have an update string like this:
<br />
UPDATE pms_tools_tasks SET Status='ToDo',Assigned='kluch',Priority='2',Title='Anything',Descript='No',Notes='Just Work',CreateDate=NULL,CompleteDate=NULL,Project='',TicketBased='0',TicketID='0',UserUpdate='',Private='0' WHERE ID=7<br />
Which works fine, But if a user enters any text with an apostrophe like for instance "doesn't work" in the title field. The update no longer executes successfully. What can I do about this?
|
|
|
|
|
Don't know 100% true for mySQL but in most databases, doubling the character tells the database to use the apostrophe as a character rather than the string terminator.
You might explore escape characters as well. Take a look at the docs because you'll want to take into account any of the characters the database treats as "special". Some are treated by doubling the occurrence of the character but others may require an escape character.
|
|
|
|
|
|
How can I cancel the addnew record process when i filled some columns in the last row of the datagrid, and I change my mind and don't want to save the new row to the database? If I cancel the beforeupdate event I am still in the last row, but I want to quit from the last row and clear its columns. How can I do that?
Thanks for any advice!
|
|
|
|
|
How to get the current selected row in DataGrid without having to use DataGrid method?
Is there any way by using the DataSet method or properties?
Thank you!
Let's roll!
|
|
|
|
|
Take a look at http://www.syncfusion.com/FAQ/WinForms/default.asp#44...
Free your mind...
|
|
|
|
|
Can anybody suggest a couple good books for ADO.Net? I've found, bought and looked through several but they all tell you how to connect to a database, download the info and then Console.WriteLine() the results.
But what about real world where the data needs to be manipulated, moved, handed off, etc? Getting into the detail of evaluating data within the tables/datasets to determine what changes have been made? Taking a subset of one of the tables and creating a new table and returning only that (no, the situation does not allow the user to do their own filtering). Patience and money is starting to build constraints and unfortunately, I don't have a lot of people here to talk to for C# and .Net.
Just wondering if anybody can suggest a couple good books. I appreciate the help.
db
|
|
|
|
|