|
I tried the commandbehavior.closeconnection option; didn't make a difference
|
|
|
|
|
MSDN2: DataReader.Close Method [^]
Remarks
You should close data readers when the consumer has completed reading data or no longer wishes to read any more data. Closing the reader ensures that output parameters, if any, are populated.
Depending on the provider implementation, the Close method may wait for the data reader to finish returning all of the specified data before closing. Compare to the Terminate[^] method.
Suggestion:
If you cannot find a provider that supports the Terminate method, you could split your SQL into chunks of 10,000 or so:
select TOP 10000 * from tblPeople where PeopleID > @nLastID order by PeopleID
Looping and creating a new reader each time until you're done, or the user cancels.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
EricDV wrote: Depending on the provider implementation, the Close method may wait for the data reader to finish returning all of the specified data before closing.
Right. I knew I remembered seeing that somewhere. However, the OdbcDataReader doesn't support the Terminate() method. I had already thought about the 'Top xxxx' method, but I was trying to avoid that if possible. Plus, on the database I'm doing it on now, there's about 3 million records, and it's already going to take hours to process those without getting all these different dataSets.
Thanks for your help, though
|
|
|
|
|
Hi,
I have a sql with an outer join that will always return 2 rows. How does the gridview know when they should be INSERTs instead of UPDATEs? It seems to always be wanting to update them. I have even changed the CreateRow routine to be an insert row but it will still calling the DataSourceControl.ExecuteUpdate instead of the DataSourceControl.ExecuteInsert. How do I get it to trigger the insert method?
Thanks, Jessica
|
|
|
|
|
no ideas? anyone?
Thanks, Jessica
|
|
|
|
|
The problem with my code at the moment is that it never goes to the second row, it will keep trying to query to the node detials. e.g: endless loop
I firstly pass the method the top node, and get its children.
So ExampleTopNode is passed to GetChildrenAndExpand, which inturn gets its children from the database and inserts it into the dataset (this works fine).
I then want to sort through ExampleTopNode's children which has now been inserted into "NodeInfo" table and get there children.
private void GetChildrenAndExpand(string Node_Name, string Node_Version)<br />
{<br />
GetChildrenFromDatabase(Node_Name, Node_Version); <br />
<br />
foreach (DataRow row in datatable.["NodeInfo"].Rows)<br />
{<br />
string NewNode_Name = row.ItemArray[0].ToString();<br />
string NewNode_Version = row.ItemArray[1].ToString();<br />
<br />
GetChildrenAndExpand(NewNode_Name, NewNode_Version); <br />
}
Regards,
Gareth.
|
|
|
|
|
Maybe not exactly what you need, but it should give you the idea
<br />
DataTable is loaded prior to this call<br />
<br />
public TreeNode GetFolders()<br />
{<br />
DataRow[] rows = DataTable.Select("ParentID IS NULL");<br />
<br />
TreeNode parent = new TreeNode();<br />
parent.Text = rows[0]["Name"].ToString();<br />
parent.Tag = rows[0]["ID"];<br />
<br />
AddChildNode(parent);<br />
<br />
return parent;<br />
}<br />
<br />
private void AddChildNode(TreeNode node)<br />
{<br />
DataRow[] rows = DataTable.Select("ParentID=" + node.Tag);<br />
foreach(DataRow row in rows)<br />
{<br />
TreeNode child = new TreeNode();<br />
child.Text = row["Name"].ToString();<br />
child.Tag = row["ID"].ToString();<br />
node.Nodes.Add(child);<br />
<br />
AddChildNode(child);<br />
}<br />
}<br />
only two letters away from being an asset
|
|
|
|
|
Thats not really what i want, as im not creating a TreeNode structure, and it doesnt really answer my question.
Thanks for trying anyways.
Regards,
Gareth.
|
|
|
|
|
I see. Have you tried using setting a DataRelation and something like this
foreach(DataRelation relation in table.ChildRelations)<br />
{<br />
foreach(DataRow row in table.Rows)<br />
{<br />
childRows = row.GetChildRows(relation);<br />
}<br />
}<br />
only two letters away from being an asset
|
|
|
|
|
I think your getting confused with with the wording in my first post. I am selecting from 1 datatable. I want to query data from a database and insert it into that datatable and at the same time, sort through the datatable for new rows which have been inserted and do the whole process again
E.g:
So, get data for bob, bob returns 3 peices of data, now get data for those 3 new rows but using the same method as in my first post.
Does that clarify it better?, the problem i beleive with my code is that im using a foreach loop to go through data which im inserting into, thus that loop will never see the new rows beeing added.
|
|
|
|
|
hi everybody,
can anybody tell me how to convert a xml file to doc,htm,pdf and doc file to pdf,htm,xml through C# code.
any help would be appreciated.
thanks in advance
|
|
|
|
|
yes
but you should know what you want to give
what i think you need can be worked out as follows
create a report and let the user save it in desired format (crystal report have it built in)
if you want to do more you should use some more dlls provided by microsoft (for doc rtf xls ) and from adobe (for pdf)
and you should read office automation (sampels provided by microsoft will work fine)
hope that will help
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
Hi!
I want to receive and send data from local computer( in network LAN) with modem(GSM/GPRS) through GPRS. My computer is connected the router that have static IP. Modem can communication with this static IP. But the problem is ... I don't know how to communication my computer with data of router from internet (using C#)? I can process all data incom router? I don't know how ? who can help me, please?
|
|
|
|
|
You have to specify more clearly what you want to do
Yes, in C#, you can make an application that listens for incoming calls/transactions from the internet, or contact another application/server over the internet.
Find out exactly what you want/need to do and take a look at all the excellent tutorials here on CodeProject.
Best regards.
-Larantz-
for those about to code, we salute you
|
|
|
|
|
I get the thing published and everything but the moment that I run the Installer I get the following error and I have no idea what it means.
PLATFORM VERSION INFO
Windows : 5.1.2600.131072 (Win32NT)
Common Language Runtime : 2.0.50727.42
System.Deployment.dll : 2.0.50727.42 (RTM.050727-4200)
mscorwks.dll : 2.0.50727.42 (RTM.050727-4200)
dfdll.dll : 2.0.50727.42 (RTM.050727-4200)
dfshim.dll : 2.0.50727.42 (RTM.050727-4200)
SOURCES
Deployment url : file:///C:/Temp/Brim/BrimApplication.application
IDENTITIES
Deployment Identity : BrimApplication.application, Version=1.0.0.8, Culture=en-ZA, PublicKeyToken=dae4239a16c6c729, processorArchitecture=msil
APPLICATION SUMMARY
* Installable application.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Temp\Brim\BrimApplication.application resulted in exception. Following failure messages were detected:
+ Exception reading manifest from file:///C:/Temp/Brim/BrimApplication_1_0_0_8/BrimApplication.exe.manifest: the manifest may not be valid or the file could not be opened.
+ Manifest XML signature is not valid.
+ The digital signature of the object did not verify.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [2006/10/24 02:25:56 PM] : Activation of C:\Temp\Brim\BrimApplication.application has started.
* [2006/10/24 02:26:16 PM] : Processing of deployment manifest has successfully completed.
* [2006/10/24 02:26:16 PM] : Installation of the application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [2006/10/24 02:26:16 PM] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Exception reading manifest from file:///C:/Temp/Brim/BrimApplication_1_0_0_8/BrimApplication.exe.manifest: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Deployment.Application.InvalidDeploymentException (SignatureValidation)
- Manifest XML signature is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
--- Inner Exception ---
System.Security.Cryptography.CryptographicException
- The digital signature of the object did not verify.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Internal.CodeSigning.SignedCmiManifest.Verify(CmiManifestVerifyFlags verifyFlags)
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
Any help will be appreciated
He who laughs last is a bit on the slow side
|
|
|
|
|
NeroToxic wrote: the manifest may not be valid or the file could not be opened.
There's your problem, you'll have to take it from here I'm afraid.
Sig cops got me...
|
|
|
|
|
Is this a Visual Studio 2005 Tools for Office problem?
If so, Visual Studio 2005 Tools for Office doesn't use ClickOnce manifest files, even though they are very similar. As a result, you can't run the .application file. The only way to run the solution is to start the Office program.
|
|
|
|
|
edboe wrote: Is this a Visual Studio 2005 Tools for Office problem?
I have no idea, never used either technology (ClickOnce or VSTO, although I'm looking into trying out ClickOnce for one app I'm working on).
Sig cops got me...
|
|
|
|
|
edboe wrote: Is this a Visual Studio 2005 Tools for Office problem?
No. I use Visual C# Express 2005.
So I created a basic windows app and used the ClickOnce Publish to create the deployment files needed. That part completes fine, the moment that I run the executable file created by the publisher, I receive the error.
He who laughs last is a bit on the slow side
|
|
|
|
|
Hi all,
I am downloading a file from remote machine using webclient
as like as below,
<br />
WebClient oclient = new WebClient();<br />
<br />
oclient.DownloadFile(hostPath,localpath);<br />
1. here how can i ensure that the file is existing at the remote machine's path(hostPath) -(eg. same as like File.Exists() function ??)
2. during this operation if the file(localpath) had already opened, this download operation will throw the exception, in this case how should i show the opened file to the user.
3. During this download operation how can i detect the LAN connection failiure (disconnected )
|
|
|
|
|
1- The DownloadFile method will throw a WebException if the file does not exits. Examine the WebException's Status and Response properties.
2- Opened by the current process or another process?
3- Again, an exception will be thrown if this occurs.
You should experiment to know what exceptions are thrown in each of the cases, and what information those exceptions provide.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Hello
Can anyone give me a hint as to how I can override the font handling in a groupbox? I need to set the font style of a groupbox title/header to Bold, but that automatically results in all labels and other controls within the groupbox doing the same. Of course one can just set each of the childcontrols' font style to regular, but that gets more complicated when using more complex user controls/custom controls.
Therefore having the ability to set the header font of the groupbox to bold without affecting child controls is what I could need help to achieve.
Thanks!
-- modified at 9:09 Tuesday 24th October, 2006
All needed for evil to prevale is for good men to do nothing.
C
|
|
|
|
|
when i am inserting data by inline sql then i am getting error like
Server: Msg 241, Level 16, State 1, Line 1
Syntax error converting datetime from character string.
and my inline sql is :-
INSERT INTO MShift (DayName,ShiftDate,ShiftEntryDate,ShiftStartTime,ShiftEndTime,
TotHour,PositionID,Department,Rate,HospitalID)
VALUES ('Wednesday',CONVERT(VARCHAR(10),'10/04/2006',121),'NULL','1200','2100','NULL','1','2','100',1)
due to the date i am getting error so pls tell me where i am wrong and pls rectify my error.
thanx....
xzv
|
|
|
|
|
I don't understand why you are converting the date. I assume that ShiftDate is a DateTime or SmallDateTime column then you should just be able to put the date in a string and it will work.
My only suggestion is that, as a general rule, you should use the ISO format yyyy-mm-dd so that the format of the date is culture independent.
|
|
|
|
|
take the quotes off of the nulls
|
|
|
|
|