If I understand your question correctly, I believe what you are trying to accomplish is something like: -Pull data down from the database -Make local changes to the data -Update again from the database*** -Push your changes up to the server And the problem you are having is merging the datasets together. If this is what you are trying to do there are two routes of action I would consider: 1- is there any way around this, so you could avoid the problem completely? I suggest you take a step back, look through your code, and see if there is a different design strategy you could follow. If you could somehow remove the step where you update from that database again, the problem would probably be straight forward. 2- if you really do need to do something like this, I suggest checking out the Microsoft Sync Framework. It is designed to sync between multiple data connections, and in addition to making the updating easy, if conflicts happen it will detect those too. Take Data Offline Using Microsoft Synchronization Services for ADO.NET[^] that is a link that looks like a pretty good introduction to Harmonica. I honestly haven't read the entire article, but it looks like a good starting ground. Let me know if I misunderstood your question. -Ken
Ken Mazaika
Posts
-
New Record in New Form problem. -
Multiple database connections -
reading audio file properties like artist,genre,album etc using VC++ 6 -
Creating sql database by using Link????Kemel, I think this might help you out. http://www.codeproject.com/KB/tips/CreateSQLDV.aspx[^] -Ken
-
we are lossing the ImpressionHi Raaj, I'm not sure what your question is, otherwise I would try to help. I'm not sure what this means:
..here problem is whenever user registering Impression that we are loss the 40% impression and here we doing geolocation also.
-Ken -
How to generate XML File using XSD and Excel(XSL) File in C#Hi abm, You might want to look at http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/b6e8a28c-6760-4e86-a1aa-e2ce9ec36380/[^] After you read in the file you can validate the XML http://www.codeguru.com/csharp/csharp/cs_data/xml/article.php/c6737[^]. If you can export the XSL file to a CSV file, you probably could built an XSLT transformation easier than using the Jet DB provider, depending on your situation. Hope that helped. -Ken
-
Using an ASP.NET User Web Control on a WSS WebPartI've spent an hour trying to do this and I can't figure out what's going on. I have a class that I derived from Microsoft.SharePoint.WebPartPages.WebPart. I built the program, and copied the dll's to C:\inetpub\wwwroot\wss\VirtualDirectories\3141\bin. I registered the WebPart through a dwp file. The webpart works great (queries a database and outputs text). I'm trying to build a User Control and include it in the webpart. To do this I put this in the Web Part's Render method:
System.Web.UI.Control control = this.TemplateControl.LoadControl(@"WebUserControl.ascx"); Controls.Add(control);
because of various examples online. Program compiles fine. I copied the WebUserControl.ascx all over the place to over all the tutorials I found that had it different places. Before I copied it to a lot of places I was getting WebUserControl.ascx file not found. Now I'm getting the exception:Request Failed
Anyone have any ideas about what I'm not doing right? I'm not installing the dll to the GAC, I'm not sure if that has anything to do with it. Thanks, -Ken -
Generate C# Symbols from IDEDoes anyone know how to do this? I looked on google, and I can only see how to do it with the command line compiler. Any help is appreciated, thanks, -Kenmaz
-
Communicating between windowsI think you have a few options. If the scenario is that the main form creates the sub form and displays it modally the easiest solution would be to just put it in a public variable, so once it closes the variable can be accessed. If its modeless it gets a little bit more tricky. I would make a class containing the string and an object. The main form constructor would initialize the class to some good default value, then you could make the form's constructor accept this new class. When the subclass wants to change the value, use one item in the class to lock the item (for threadsafeness) and then set the string value. The main class could then lock the string, and read it. Hope this helped, -Kenmaz
-
XML Serialization with subclassHi, I'm trying to serialize a simple configuration class that contains a few methods and primitive types. It also contains one very simple class:
[XmlRootAttribute(ElementName = "WildAnimal", IsNullable = false)]
class Config
{
public int a;
public int b;
public SimpleClass classinst;public Config() }
class SimpleClass
{
public int c;
public int d;public SimpleClass() }
Along with Serialize/Deseriailze functions inside the Config class:
public void SerializeObject(Object pObject) { try { FileStream fileStream = new FileStream(s\_strBaseThemeDirectory + @"\\" +m\_strName+".xml", FileMode.CreateNew, FileAccess.ReadWrite); XmlSerializer xs = new XmlSerializer(typeof(Config)); XmlTextWriter xmlTextWriter = new XmlTextWriter(fileStream, Encoding.UTF8); xs.Serialize(xmlTextWriter, pObject); fileStream = (FileStream)xmlTextWriter.BaseStream; fileStream.Close(); } catch (Exception e) { Utilities.Trace("Error Serializing the XML: " + e.ToString()); } } public Configuration DeserializeObject(string strName) { FileStream fileStream = new FileStream("filename.xml", FileMode.Open, FileAccess.ReadWrite); XmlSerializer xs = new XmlSerializer(typeof(Config)); XmlTextWriter xmlTextWriter = new XmlTextWriter(fileStream, Encoding.UTF8); return (Configuration)xs.Deserialize(fileStream);
}
Everything works fine without the SimpleClass, but when that gets thrown into the mix I've been running into exceptions being thrown (the SimpleClass is actually in an Arraylist). Any idea how I should get around this issue? Thanks! -Ken
-
Wireless PC to HDTV?I haven't used that, but I saw a presentation on Windows Media center, which looks pretty cool. I'm pretty sure the same functionality can be had with an xbox 360, if you don't mind it being wired, and I think it would cost about the same.
-
Beginner's C# BookHi, I'm trying to convince a friend of mine to learn C#, and he's looking for a good book to start with. He has experience with VB 6, but isn't very familiar with oop. Any suggestions? Thanks, -Ken
-
Creating a new Template ItemThanks for your response. That solved the problem completely. I created a LList.cpp file, which I didn't treat as a header, I added the template definitions to the header and it worked perfectly. Thanks again for your response! -Ken
-
Creating a new Template ItemHi, I made a Stack implementation, and now I'm looking to make the implementation be more generic. I know that the way to do this is probably to use template. I have a cons list of items which is
template class ConsList : public LList { .... ConsList(T first, LList* rest); //constructor }
as of now. When I try to make an instance of the ConsList with the new keyword, I get a lot of errorsg++ -o Main LList.o Stack.o Exception.o main.o Stack.o: In function `Stack::push(int)': Stack.cpp:(.text+0xaa): undefined reference to `ConsList::ConsList(int, LList*)' Stack.o: In function `Stack::Stack()': Stack.cpp:(.text+0xe5): undefined reference to `EmptyList::EmptyList()' Stack.o: In function `Stack::Stack()': Stack.cpp:(.text+0x123): undefined reference to `EmptyList::EmptyList()' collect2: ld returned 1 exit status
I've googled templates, and it looks like nobody makes a new item that is a template. If there a reason why people don't use this, or how would I go about creating an instance of ConsList(.., ..). Thanks, -Ken -
Setting this to something elseHaha, that explains why my attempts to do it all failed. Thanks, -Ken
-
Setting this to something elseHi, I'm looking for a way to change what this points to. I want to make a function that essentially does this = new InstanceOfAClass(value, this), for a linked list, but but I can't figure out how. I feel like this is a pretty basic question, but I can't find the answer. Thanks, -Ken
-
User Accountsthanks christian. the word 'session' was what i was looking for. I appreciate it...thanks a lot man, -ken
-
Create ASPX pages on the flyI actually solved this problem earlier. My solution worked because I used the same C# code file on each of the aspx pages. I'm sure it could be done otherwise, but it was easy to do that way. What I did was create a base aspx file that had all the things the aspx file would need with a specific comment where the changing data would be. I then used a streamreader and streamwriter to go through the two files. When the file got to the comment it would then use a different stream reader for that sections contents, and then continue to read the rest of the base ifle. There might be an easier solution, but this worked fine for me. -ken
-
User AccountsHi, I'm making a website in ASP.NET (C#) that handles users. How do I store data specific to the user's connection. I got it working using static variables, but it turns out that all users have the same values for static variables (which makes sense now that I think about it). How can I "remember" the user id of someone who logged in and not have it mix up other users? I know I could do it by using a static hashtable of userids and ipaddresses but I feel like this is probably a more complicated solution than it needs to be. I know this is probably a pretty common question, and I'm sorry if its been asked before. Any response would be helpful though. Thanks,
-
Installation SystemHi, What Installation System do you recommend the most? Do you know of any side-by-side comparisons of the big ones out there (I searched for a while with no luck)? Currently my company uses InstallShield but we're looking into moving into an OpenSource installer (probably Inno or NSIS) and I was wondering if there were any clear cut advantages to one installer vs the other (No one here has any experience with either one). Thanks.