|
I would recommend avoiding all those 'Add New Item->Dataset' and tableAdapter options, if you write actual code, you get a lot more control.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'll second that. If it's not visible on the form don't add it with the designer.
Of course, I also don't use DataAdapters/TableAdapters or DataSets anyway.
|
|
|
|
|
I remember during the class lecture my teacher said whenever you are trasferring an object through wire make that object as a Serialized. I have seen example how to make a class serialized in class and online. But i have 2 questions.
1 But why do we need to make it and why can't i just send an object and the receiving function write
whatever the object contains? Currently i am writing to a file without any seriazation i don't have any problems.
2. In xmlSerialzation how can i update only specific elements and it's sub elements rather than re-writing the entire object which may have so many elements? i.e I do'nt want to write the entire object just the changed data to be written again.
I know I have to search for that speicfic node and then write but any example shall help me alot.
Thanks
modified on Wednesday, June 4, 2008 4:57 PM
|
|
|
|
|
1 - Serialisation automates the process of representing the contents of a class as text. If you have another way of doing that, it's going to work just the same, so long as the code on both ends knows how to deal with the stream.
2 - how do you mean, exactly ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for answering but...
1. How one can utilize the benefit of represting the contents of a class as text? What about an image in xml file can that be converted to a readable text format.
2. Lets say a parent object that has many different types of child objects are written to a xml file. When a child object is changed only that to be rewritten to the xml file. I don't want to rewrite the entire parent object so i can have quick save functionality.
|
|
|
|
|
netJP12L wrote: What about an image in xml file can that be converted to a readable text format.
Not really
netJP12L wrote: Lets say a parent object that has many different types of child objects are written to a xml file. When a child object is changed only that to be rewritten to the xml file. I don't want to rewrite the entire parent object so i can have quick save functionality.
OK, you have to write the entire file, but you could write code to manage what you're describing, I think. You'd have to cache the serialised text, serialisation by default does not do that. You'd also have to track changes to know which bits to recreate.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
netJP12L wrote: trasferring an object through wire
I expect that doesn't include files.
You don't need to, but it may be good practice for when you do need to.
Also, I would always write custom serialization; the automated serialization is generally too limited.
|
|
|
|
|
Hi
I need to take the user session ID number (maybe is called session token or SID) in my windows C# application, it is a unique number per session, same user different sessions should have different numbers. I tried a lot of ways (almost everything from win32) without success....
|
|
|
|
|
MeNot,
I am guessing you're talking ASP.NET. This?[^]
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
No, it's windows application, every windows session has a ID (if I am sure).
My problem is that I log the user in a service (in another machine) using just his user id, but if he restart his machine I should be able to log him again, and for this I need an information about his session at windows.
|
|
|
|
|
Hi, i'm trying to write a function where i can do this:
private bool ParameterCheck(Type[] expected, object[] actual)
{
if (actual.Length != expected.Length)
return false;
for (int i = 0; i < actual.Length; i++)
{
if(actual[i] as expected[i] == null)
return false;
}
return true;
}
The goal is to check if a object array is the same length and same type as some expected parameters.
|
|
|
|
|
FocusedWolf wrote: if(actual[i] as expected[i] == null)
if (actual[i].GetType() != expected[i])
Life, family, faith: Give me a visit.
From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord."
Judah Himango
|
|
|
|
|
Oops, wrong answer, see mine
|
|
|
|
|
I see them both wrong, see another one
|
|
|
|
|
You could, but them the method would not be called paramatercheck.
|
|
|
|
|
Bah, well, I made his code compile, didn't fix his problems. Call me an ugly patcher.
Life, family, faith: Give me a visit.
From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord."
Judah Himango
|
|
|
|
|
Look at Type.IsInstanceOfType()
|
|
|
|
|
Brilliance.
You would have thought that runtime would let you call the method and catch the exception
(no language in the world should allow for that scenario)
|
|
|
|
|
can any one help me. i am new to c# and i have to make an online timetable schedular using round robin algorithm. plz can any one help me in this plz plz this is my final project plz help me
modified on Wednesday, June 4, 2008 1:56 PM
|
|
|
|
|
Member 3633992 wrote: my final project
Oh I hope you have a flame retardant suit.....
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace NeedsCode
{
class Program
{
static void Main(string[] args)
{
throw new NotImplementedException("The program code needs to be implemented.");
}
}
}
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.”
-Edsger Dijkstra
|
|
|
|
|
I've created a monster weeeeeee!!
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
I thought I'd seen that excellent code example before. It has so many uses too.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Have you thought about studying languages instead of programming? Here's an example to maybe inspire you to consider the possibility of taking a new direction.
Incorrect:
can any one help me. i am new to c# and i have to make an online timetable schedular using round robin algorithm. plz can any one help me in this plz plz this is my final project plz help me
Correct:
I have searched the internet and this site, but I couldn't find any examples or theories to help me progress, so I was hoping that someone here may know of some resources that may help. The task I have been assigned is to produce a Timetable Schedular using a 'round robin' algorithm.
I am new to C#, but I have worked through 'xxx' examples/articles to try and get a basic knowledge. The code below is what I have attempted so far.
Your code goes here...
Any assistance you could give by way of code correction, theory, or other links to help me finish my final project would be greatly appreciated.
Dave
|
|
|
|
|
Member 3633992 wrote: this is my final project plz help me
How did you get this far, if you have no idea how to write code, how to use google, or how to properly ask for help online ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|