|
The value of fieldNodes.Count is 0. so the condition failed in the below if condition
if (fieldNodes != null && fieldNodes.Count > 0)
|
|
|
|
|
check line fieldNodes = node.SelectNodes("/StudentClass");
see other ways to get all StudentClass if it fails.
else try this
foreach (XmlNode node in fieldNodes)
{
if (node.Attributes["ID"].Value == "101")
{
studentNode = node["StudentClass"];
if(studentNode != null)
{
foreach (XmlNode nodeClass in studentNode.ChildNodes)
{
if (nodeClass.Attributes["ref"].Value == "F_STRENGTH")
{
refNode = nodeClass;
break;
}
}
}
break;
}
}
|
|
|
|
|
|
my pleasure
|
|
|
|
|
I am using following query to insert some large text data :
internal static string InsertStorageItem =
"insert into Storage(FolderName, MessageId, MessageDate, StorageData) values ('{0}', '{1}', '{2}', @StorageData)";
and the code I am using to execute this query is as follows :
string content = "very very large data";
string query = string.Format(InsertStorageItem, "Inbox", "AXOGTRR1445/DSDS587444WEE", "4/19/2010 11:11:03 AM");
var command = new SqlCeCommand(query, _sqlConnection);
var paramData = command.Parameters.Add("@StorageData", System.Data.SqlDbType.NText);
paramData.Value = content;
paramData.SourceColumn = "StorageData";
command.ExecuteNonQuery();
But at the last line I am getting this following error :
System.Data.SqlServerCe.SqlCeException was unhandled by user code
Message=The data was truncated while converting from one data type to another. [ Name of function(if known) = ]
Source=SQL Server Compact ADO.NET Data Provider
HResult=-2147467259
NativeError=25920
StackTrace:
at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
at Chithi.Client.Exchange.ExchangeClient.SaveItem(Item item, Folder parentFolder)
at Chithi.Client.Exchange.ExchangeClient.DownloadNewMails(Folder folder)
at Chithi.Client.Exchange.ExchangeClient.SynchronizeParentChildFolder(WellKnownFolder wellknownFolder, Folder parentFolder)
at Chithi.Client.Exchange.ExchangeClient.SynchronizeFolders()
at Chithi.Client.Exchange.ExchangeClient.WorkerThreadDoWork(Object sender, DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
InnerException:
Now my question is how am I supposed to insert such large data to sqlce db?
|
|
|
|
|
You need to split it over several records as it is too large for the data type. Use a sequence number on each record to allow you to stitch it back together in the right order. As an alternative, would it be possible to put the data in a file and store the file details in the database?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi Bob,
Thanks for your reply. Let me tell you one thing that I am going to create a desktop mail storage. Still I am not sure how to store the messages in an elegant way. This was my first try to store the content of the message in sqlce db. Is there any other better way to do this?
|
|
|
|
|
There is no nice solution. Each datatype of any database, be it sqlce, oracle, sybase or whatever has a size limit and there is no way around this. In the past when storing large data items I have had to split the data over several records and join them back together for display etc.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Anindya Chatterjee wrote: I am going to create a desktop mail storage
Let me know what are the step(s) you following currently....For example read email one after another and store it to the database....
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
What I am following are a very simple steps as follows:
Start application
search for accounts in settings
if nothing found
show creation dialog
create folder and storage tables
save the settings
if found
check for folder structure
if not synchronized
create folders at folder table
add its parent folder if any
check for mails in each mail
if not uptodate
download mails for each folder and save to storage table
if uptodate
start the listeners
|
|
|
|
|
Hi.
Anybody know how to equivalent in C# following types :
CInternetSession session;
CHttpConnection* pServer = NULL;
CHttpFile* pFile = NULL;
Thanks .
We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
HTTP stuff is contained in the System.Net[^] namespace. The WebRequest[^] class example demonstrates a typical usage scenario.
|
|
|
|
|
Hi,
Is there any .Net open source tool which basically detect all the devices which are connected over the connected network like Printer, Router etc ?
|
|
|
|
|
good day to everyone... I would like to know, how to deploy my .net web service in win7...I'm getting a hard time making it functional in win7. thanks a bunch for your help.
|
|
|
|
|
1. You probably need to describe what it is that doesn't work for anyone to be able to help you.
2. I would be surprised if there wasn't any good articles/videos/tutorials on this matter. No luck on google?
|
|
|
|
|
no luck on google...or maybe i'm just querying a wrong question...i'm about to test my web service in win7.but unfortunately, i'm having a hard time figuring out how to configure the IIS7 to deploy my web service.i also want to test through my vmware before i deploy it.but i can't manage to make my apps in vmware which,am using winxp to communicate with my web service in win7...thanks u bunch again...
|
|
|
|
|
Maybe this article on Codeproject will get you started. Don't know if there are any specific tricks on Win7 though..
What errors are you facing in your vm-ware system running WinXP?
|
|
|
|
|
i've already seen that article...the article is not that detailed in explaining on how to deploy a website.still, thank you...
|
|
|
|
|
You can try this[^] one for deploying App to IIS7.
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
I am getting a weird delay when writing a file. I am not able to figure out where the delay is coming from.
The facts:
I map a drive to a NT server (W:\)
I copy a file at W:\largefile.dat to W:\Archive\largefile.dat
My copy loop:
try
{
using (FileStream sourceStream = new FileStream(nd_CopyDrive.LocalDrive + "\\" + fi.Name, FileMode.Open))
{
byte[] buffer = new byte[64 * 1024];
using (FileStream destStream = new FileStream(nd_CopyDrive.LocalDrive + "\\Archive\\" + fi.Name, FileMode.Create))
{
int q;
while ((q = sourceStream.Read(buffer, 0, buffer.Length)) > 0)
{
destStream.Write(buffer, 0, q);
}
}
}
}
When the file is completely written my program hangs at the closing bracket for the second using statement.
Nothing is shown in the Output window that gives me some clues. This block of code IS running in a background worker as added information.
Could my problem be related to how the CLR "releases the memory used to store objects that are no longer required".
If I place a debug marker at that ending bracket and perform a step into, the Output window shows:
Step into: Stepping over method without symbols 'System.IO.Stream.Dispose' (which takes forever to complete)
Any help would be greatly appreciated!
|
|
|
|
|
I'll bet if you put a call to destStream.Flush() just after the Write while loop, it would solve the mystery.
I'm reasonably sure that the delay is due to the data actually being written to the file.
|
|
|
|
|
Flush is called by Close which is called by Dispose, which, of course, is called when leaving the using scope.
So no, calling Flush before the won't actually do anything different.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
It would solve the mystery by exposing exactly what's causing the slowdown.
|
|
|
|
|
Will it give information about network latency, data packets, etc.? No, it won't expose anything more than an extra statement to set a break point on.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
When you step over it, it will take a long time to execute the Flush statement.
It would solve the mystery for me, maybe someone else would be too dense.
|
|
|
|