|
Is there an easy way to clone a DataTable?
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
DataRow[] sourceRows=sourceTable.Select();
DataTable targetTable=sourceTable.Clone();
foreach(DataRow sourceRow in sourceRows)
targetTable.ImportRow(sourceRow);
eperales
|
|
|
|
|
what is s1ck about that is that I just clone the table without its rows; all I need is the schema.
Thanks E.
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
DataSet ds;<br />
ds.Clone();
From MSDN:
DataSet.Clone Method
Copies the structure of the DataSet, including all DataTable schemas, relations, and constraints. Does not copy any data.
[C#]
[Serializable]
public virtual DataSet Clone();
Return Value
A new DataSet with the same schema as the current DataSet, but none of the data.
|
|
|
|
|
Hello:
I am trying to develop a sink that will intercept the constructor and destruction messages for my remoted objects on the server side so I can track the performance.
I know I have to use the following code, but am unsure on how to continue?
Please Advise!!!!
<br />
public class TrackerSink : IMessage<br />
{<br />
IMessageSink _nextSink;<br />
<br />
public TrackerSink(IMessageSink nextSink)<br />
{<br />
_nextSink = nextSink;<br />
}<br />
<br />
#region IMessage Members<br />
<br />
public System.Collections.IDictionary Properties<br />
{<br />
get<br />
{<br />
return null;<br />
}<br />
}<br />
<br />
#endregion<br />
<br />
public IMessage SyncProcessMessage(IMessage msg) <br />
{<br />
return _nextSink.SyncProcessMessage(msg);<br />
}<br />
<br />
public IMessageCtrl AsyncProcessMessage(IMessage msg, IMessageSink replySink) <br />
{<br />
return _nextSink.AsyncProcessMessage(msg,replySink);<br />
}<br />
<br />
public IMessageSink NextSink <br />
{<br />
get <br />
{<br />
return _nextSink;<br />
}<br />
}<br />
}<br />
|
|
|
|
|
OK, Is there anyone out there who has any idea of how to do this??? I have asked this question on multiple boards and multiple times. Research has lead me to only knowing that the constructor and destructor messages are communicated with the IMessage interface, but I have no clue on how to implement this. PLEASE, someone help!!!!!
|
|
|
|
|
I guess that this idea is something that hasn't been approached or not by anyone here. Thank you if you tried to research the issue, but I am not going to move on to a new approach since I have searched in vain for this answer.
|
|
|
|
|
using System;<br />
using System.Runtime.Remoting;<br />
using System.Runtime.Remoting.Channels;<br />
using System.Runtime.Remoting.Channels.Tcp;
error: C:\Visual Studio Projects\Server\Class1.cs(4): The type or namespace name 'Tcp' does not exist in the class or namespace 'System.Runtime.Remoting.Channels' (are you missing an assembly reference?)
i'm trying to follow a tutorial which uses this namespace, but it doesn't appear to exist.
when is type: using System.Runtime.Remoting.Channels.
i get no drop down for any other options.. and when i manually just force it in, i get a compile error that the tcp methods dont' exist.
can anyone help?
|
|
|
|
|
Mike,
You have to add a reference to System.Runtime.Remoting to your project.
|
|
|
|
|
thank you! i thought i could just call it.
|
|
|
|
|
I'm developing an application on the Compact .Net platform in C#, and I am wondering what the best strategy is for setting up multiple forms. Should my child forms simply be controls on a main form as in the IBuySpy sample, or should I set up actual System.Windows.Form forms for my sub forms? Or, should I set up each form as a separate project altogether? I do need to share a database amongst the forms, so I may be restricted on how independent the forms can be. Any thoughts?
|
|
|
|
|
In my windows app, I am referencing a web service. Now the web service moved, do I need to recompile my windows app. Is there a way where I can set a configuration file or something where the next time it moves I can just cahnge on file instead of compiling the whole component.
|
|
|
|
|
The webservice object has a URL property.
You should be able to use this to do what you require.
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG picture :: my first abstract photo
|
|
|
|
|
I am developing a web application that displays information in a datagrid. As users navigate the data, the datagrid redisplays new data. I am running into a problem when the users us the back button in their browser and the datagrid getting out of sync. How can I keep this information in sync? What techniques are used to synchronize this information? Thanks in advance.
|
|
|
|
|
Hi Folks,
Is there an easy way in C# to get the \Documents and Settings\CurrentUser\Application Data folder path?
Thanks
Davy
My Personal Blog - Homepage. Scottish News - Angus Blog, Perth Blog and Dundee Blog
|
|
|
|
|
Application.CommonAppDataPath or Application.LocalUserAppDataPath
Also this shell method do it:
SHGetSpecialFolderLocation()
Mazy
No sig. available now.
|
|
|
|
|
|
hi,
i want to create a xml document like b4 format. i did sth with xmlnode, xmldocument... but, i still can't add attribute to "chartdataisland"...
can anyone help?
XML Doc:
<?xml version="1.0" encoding="utf-8" ?>
<chartdatalist>
<chartdataisland legend="Phase 01">
<chartdata>
<x>5</x>
<y>73.3</y>
</chartdata>
</chartdataisland>
<chartdataisland legend="Phase 02">
<chartdata>
<x>5</x>
<y>23.3</y>
</chartdata>
</chartdataisland>
<chartdataisland legend="Phase 03">
<chartdata>
<x>5</x>
<y>12.3</y>
</chartdata>
</chartdataisland>
</chartdatalist>
CODE:
XmlDocument doc = new XmlDocument();
doc.LoadXml("<?xml version=\"1.0\"?>" + "<chartdatalist>"+"</chartdatalist>");
XmlNode dataislandElem = doc.CreateNode(XmlNodeType.Element, "chartdataisland", "");
XmlNode dataElem = doc.CreateNode(XmlNodeType.Element, "chartdata", "");
XmlNode XElem = doc.CreateNode(XmlNodeType.Element, "x", "");
XElem.InnerText="12";
XmlNode YElem = doc.CreateNode(XmlNodeType.Element, "y", "");
YElem.InnerText="24";
dataElem.AppendChild(XElem);
dataElem.AppendChild(YElem);
dataislandElem.AppendChild(dataElem);
XmlElement root = doc.DocumentElement;
root.AppendChild(dataElem);
|
|
|
|
|
Have you tried using the XmlTextWriter class? It has a number of methods for writing the nodes, and the one you'd need WriteAttributeString() .
|
|
|
|
|
XmlDocument.CreateAttribute() ?
Mazy
No sig. available now.
|
|
|
|
|
|
Hi this is kind of an embarassing question- do I actually need to run an SMTP server to send an email? What I want to do is have my desktop windows app (Form) send an email when the user clicks a button. If the user installs my app, do I need to also install an SMTP sever on the user's local machine?
I've read a lot about using the System.Web.Mail stuff. But I'm getting the "Could not access 'CDO.Message' object." error when I set SmtpMail.SmtpServer="localhost".
I tried all the suggested fixes- I have Outlook installed, I'm using valid addresses for To and From, I tried setting SmtpMail.SmtpServer to "".
Do I have to install an SMTP server on the user's machine in order to send an email?
thanks
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
Bog wrote:
Do I have to install an SMTP server on the user's machine in order to send an email?
No...you just need to point to the user's SMTP server at their ISP...
I passionately hate the idea of being with it, I think an artist has always to be out of step with his time.
-Orson Welles
|
|
|
|
|
Well, thanks but that won't do. I have verizon, for examle, and Verizon doesn't let you send email where the From address is anything besides the email address verizon gives you. If you want to send email From any other address you have to use a different SMTP server. Also where could I find out what the user's ISP's SMTP server is? Like if they don't have Outlook installed, or it's not set up (wrong or missing SMTP for example).
thanks anyway for your response.
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
Here's an idea, if you have Outlook installed in the user's machine, why not just use the Outlook Com object.Add a reference to the Com, and add the following code:
Outlook.Application ol = new Outlook.Application();
Outlook.MailItem ml;
ml = ol.CreateItem(olMailItem);
ml.Body = "message body";
ml.To = email address;
ml.SenderName = your email;
ml.Send();
warning : the code above is modified from vba, so it might not exactly like expected.
God, I pity me! - Phoncible P. Bone
If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you
|
|
|
|