|
You're right - it is simple: simply create a new OleDbCommand around an UPDATE statement, or if you just change it in the DataSet like I showed you before, pass it back to an OleDbDataAdapter using the Update method, which requires that you have the OleDbDataAdapter.UpdateCommand assigned (plus InsertCommand and/or DeleteCommand if you want to support INSERT and DELETE statements as well). The SelectCommand is required.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How about
myRow["curr"].Value = false;
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
BillAnton wrote:
Clues?
Yeah - try reading the .NET Framework SDK documentation, seriously. OleDbDataAdapter.Update takes a DataSet . As I said, you update the value in your DataSet (via the DataRow as I coded in my first reply). Then, you pass that DataSet (without calling AcceptChanges first) to OleDbDataAdapter.Update . If you have your OleDbDataAdapter.UpdateCommand set to a valid OleDbCommand with an UPDATE SQL statement, then the value in the database will be updated.
Sorry, I hate to sound rude but this is supposed to help you learn, not just take what I or anyone else said (which you didn't follow my directions anyway) and using it. Learn why I or anyone else said that and understand. That's what's important.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a showmodaldialog window where user will create one server object, can anybody let me know how do i pass the server side object back to parent window
|
|
|
|
|
In the ShowDialog window, you would make this object public and fill it with the necessary information with the normal course of your ShowDialog code. When you ShowDialog method returns to your main form code, your main form would have to set a reference to the public object, then call Dispose on the ShowDialog form.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Gurus
Is there any free/community/gnu/open source/whatever C# refactoring addin for visual studio?
|
|
|
|
|
Visual Studio .NET 2005 will come with this, I just saw a demo of the Refactoring and it is sweet.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi there!
I've once seen some tools mentioned in a magazine. First had to search this, so the answer took a bit longer. Can't say if they are helpful because i never used them myself.
Search the web for "opnieuw" and "Name Manager for VS.NET". The second one is developed by the firm ScrujSoftware but should be free of cost.
Hope this helps!?
www.troschuetz.de
|
|
|
|
|
Stefan Troschütz wrote:
Can't say if they are helpful because i never used them myself.
Same here, I too damn scared they break my 31337 code
top secret xacc-ide 0.0.1
|
|
|
|
|
hello,
i would like to know if there's a method in C# that can copy a hole directory with its files and subdirectories.
thanks
|
|
|
|
|
I don't believe there is; the framework is a little more modular than that: you can use File.Copy to copy a file or Directory.CreateDirectory to make a duplicate directory. From there, just call File.Copy on each file returned from Directory.GetFiles() and call Directory.CreateDirectory on each sub directory, then do this recursively for each folder.
#include "witty_sig.h"
|
|
|
|
|
|
my way to do it
private void cmdCopy_Click(object sender, System.EventArgs e)
{
if(!Directory.Exists(txtDist.Text))
{
MessageBox.Show("Please enter a valid path");
return;
}
DirectoryInfo dir=new DirectoryInfo(txtSrc.Text);
CopyDirectory(txtSrc.Text,txtDist.Text+"\\"+dir.Name);
MessageBox.Show("OK");
}
private void CopyDirectory(string src,string dist)
{
if(!Directory.Exists(dist))
Directory.CreateDirectory(dist);
FileInfo file;
DirectoryInfo dir;
string[] strFiles;
string[] strDirs;
strFiles=Directory.GetFiles(src);
foreach (string strFile in strFiles)
{
file=new FileInfo(strFile);
file.CopyTo(dist+"\\"+file.Name);
}
strDirs=Directory.GetDirectories(src);
foreach (string strDir in strDirs)
{
dir=new DirectoryInfo(strDir);
if(dir.FullName==dist)
continue;
CopyDirectory(dir.FullName,dist+"\\"+dir.Name);
}
}
|
|
|
|
|
Hello,
Why won't this work?
ds.ReadXml(filePath);
dtgAppserver.DataSource = ds;
dtgAppserver.DataMember = "appserver";
the xml-file looks like this:
<session name="dfghjgfd">
<appservers>
<appserver name="">
<appservice></appservice>
<autoconnect>false</autoconnect>
</appserver>
</appservers>
</session>
The compiler says:
An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll
Additional information: Cannot create a child list for field appserver.
what can i do about this?
thx an advance
|
|
|
|
|
Not any XML document can be read into a DataSet . 2- and 3-tier schemas can, and attributes on the "table" tier act as fields along with any child elements. This schema will not work in a DataSet . See XML and the DataSet[^] in the .NET Framework SDK for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
As i have not a lot of experience with object oriented programming and design pattern, I'm here to ask for help.
This is the problem i have to resolve.
I have a database in which are stored both the structure and the content of a web application.
The structure is expressed in term of HDM methodology, i.e. a page is made up of "Entity" (data of interest to the user) or "Collection" (organised set of information object). An Entity is organised in semantic sub-units called "Components", which are pure organisational device for grouping the contents of an entity into meaningful chunks. Components can further be decomposed in sub-component, but the actual content can be associated with leaf components only. The contents of leaf components is defined in terms of "Slot" - attributes that define the primitive information elements.
A "Semantic association" connects two entities - creating an infrastructure for a possible navigation path - and has a local information object called "Association Center" which contains data that define and specify the association itself and provide additional information on how to represent both the single target elements, in a concise way, and the whole group of target elements that relate to the same source.
Collections also provides the user with a way to explore the information contents of the application- they give a preview of the target element expressed as a set of "Slot" called "Segment".
The only pattern i have identified is the Composite, but i'm sure there is more.
Moreover in the future this system have to deal with multiple user (but this is not my problem, at the moment).
Thank you, bye.
|
|
|
|
|
So what's your question?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I forgot to say that when navigate through a "Collection" o "Semantic association" the same "Entity" instance can be accessed by different way - i can find the book "It" under the "King book" collection or under the "Horror book" collection and in both case the next(previous) instance depend on the structure i navigate.
Stated that,the main question is:
1) which design pattern can i use to manage this navigational mechanism?
and also :
which class diagram better illustrate the entire problem?
thank you
|
|
|
|
|
I got a pictureBox and I put an image on it.
please show me how to print that image.
Thanks
Rock Throught The Night
|
|
|
|
|
|
Hai,
I am new to C#, Can any one find a solution for my problem. I created an webservice and itz working fine in my localhost but getting error when uploaded in to my webserver, I am getting an error like
Server "\" App
please give me a solution
Thanks in Advance
VV
|
|
|
|
|
Nice double post. You'll probably be waiting a long time for this one.
Vinod2508 wrote:
please give me a solution
This is very cocky!
Yes, I program in VB6, but only because I use it to fill my addiction to having a dry place to sleep and food to eat!
|
|
|
|
|
Hai,
I am new to C#, Can any one find a solution for my problem. I created an webservice and itz working fine in my localhost but getting error when uploaded in to my webserver, I am getting an error like
Server "\" App
please give me a solution
Thanks in Advance
VV
|
|
|
|
|
Be more specific. What is the entire exception type and message? Typically, when you move a web application and get errors, it's either because some dependent assembly isn't located on the server (or at least where you think it is) or because you hard-coded paths and they aren't the same. With the actual exception text, it's impossible to say.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thankz for your reply
Can u please tell me the step to host an web service
I have created an web application on local host and it is working fine on my localhost. When I uploaded it in to my remote host it gave me error. what I have done is that
Copied my application directory in to a virtual directory on host which have .net support.
Waiting for Your Valuable reply
Thanks in advance
|
|
|
|