|
The operative word there being try, of course.
P.S. Do you always submit message board posts that make you sound like a total moron, or was this just an isolated instance?
|
|
|
|
|
Furty wrote: Do you always submit message board posts that make you sound like a total moron, or was this just an isolated instance?
Dude i was showing u the right path for programming
|
|
|
|
|
Meer Osman Ali wrote: Dude i was showing u the right path for programming
Right. Gotcha.
I had you pegged as a trolling wanker, but thanks for the confirmation!
|
|
|
|
|
Furty wrote:
I had you pegged as a trolling wanker, but thanks for the confirmation!
Gee have a nice day then
|
|
|
|
|
If it farts like a troll, smells like a troll, and looks like a troll, shouldn't we just castrate it?
|
|
|
|
|
Absolutely not. It would fart, smell and look like a troll even more,
and scream its heart out on top of that.
On the other hand, if it intends to procreate, you would have to
accept these short-term disadvantages, and go for the long-term benefits.
Or act a little more effectively and solve the problem once and forever.
PS: nothing much has changed around here, has it?
|
|
|
|
|
Luc Pattyn wrote: PS: nothing much has changed around here, has it?
Same ol', same ol'. Mind you, I've spent the last month or so working on a bit of Open Source work along with Karl Shifflett, so I've spent less time in the forums as a result.
|
|
|
|
|
No, pretty much every post he's made is from a completely ignorant viewpoint.
|
|
|
|
|
Allah has given us C#. Java is an abomination to Allah, a heretic language. Are you rally suggesting that we ignore the progress that He has granted us? Ignore type-safety? Drop the increased productivity?
That sounds like the arrogance that Iblis would display
As Spock would say, "Live long and prosper"
|
|
|
|
|
I created a xsd file using a xml, and then loaded it into a dataset. It created several tables according to the xsd. I notice that each table has a auto-generated column (name ends with ..._id, it looks like the dataset uses these ids to determine the relations between each table).
the problem I am having is that when I fill each table in the dataset with data, then write it out to a xml file, the xml file does not come out in the format defined by xsd, e.g. the child element becomes sibling elment of the parent element
defined in xsd
<parentelement>
<firstelement></firstelement>
</parentelement>
output xml file will become
<parentelement>
</parentelement>
<firstelement>
</firstelement>
When I debug it, I find out that the reason is that in dataset, the auto-generated "parentElement" table's id(key) column is updated automatically(0,1,2...), but the "childElement" table's id column is still empty, therefore cause the two table not to "link" to each other(I found out that by adding child table's id column with 0,1,2.., the xml will come out in the correct format).
I use
adp.fill(ds, "parentElement") and adp.fill(ds, "firstElement") to fill both table, can't figure out why only the parent table's id column is auto-populated not the child one.
Please experts help!!
|
|
|
|
|
It seems that you might have problems with mapping datasets to xml's.
You can find here[^] excellent code snippets, which will lead you to the correct solution.
SkyWalker
|
|
|
|
|
Hi
I have 4 arrays which i want to insert them into 4 columns of a table of my sql server 2000 database, and it should be done at once, not inserting one by one. How can i do this?
|
|
|
|
|
Transactions
http://en.wikipedia.org/wiki/Atomicity_(database_systems)
|
|
|
|
|
Easiest way is to create a stored procedure and pass the data as parameter to server side. This requires only single call to db.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
I have read somewhere that I should use union all like this:
<br />
use myDb<br />
insert into myTable (columnName1,columnName2...)<br />
select row1value1,row1value2...<br />
union all<br />
<br />
select row2value1,row2value2...<br />
union all<br />
.<br />
.<br />
.<br />
but I don't know how pass the arrays to the stored procedure and how perform these in a loop to add all array elements automatically...
|
|
|
|
|
Union is only usable in db when you combine several result sets. You cannot use it to pass arrays from client. I don't remember if you can pass table type parameter in sql server 2000. That would be a solution in your case. It's not automatic so you must program the insert loop inside the procedure.
Another option is to use SqlBulkCopy class. Have a look at that also.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
My teacher now and then says that you should be very restrictive with global variables since they, according to him, are not recommended in object oriented programming.
Still he uses global variables himself. An example is that he creates objects which he refers to with global variables in windows applications.
With this as a background I wonder:
Are global variables really dissuaded in OOP? I am especially interested in knowing if global declaration and initialization of objects, which my teacher does, is OK.
|
|
|
|
|
You should restrict access as much as possible. But if it's not possible to restrict it anymore, than a global object is ok, I'd say.
Of course it's also possible to pass the object to every constructor or function as a parameter.. but this can get really complicated, especially if you notice that you need such an object after already having some code.
|
|
|
|
|
I suggest using a dependecy injection container (Unity Application Block, Castle's Windsor Kernel, Spring.NET). Then you have only one single global variable, the container itself.
All other global variables will make unit testing, decoupling of components and maintenance a great bit more difficult.
Happy coding
Urs
-^-^-^-^-^-^-^-
no risk no funk
|
|
|
|
|
An object-oriented approach to obtaining the functionality of global variables is the Singleton design pattern. http://en.wikipedia.org/wiki/Singleton_pattern[^]
You can even put multiple variables into your Singleton that need global access.
|
|
|
|
|
Hi All,
If I have two lists and one is a subset of the 'main' list what's the quickest/best way to sort the sub list into the same order as the source main list?
Cheers,
|
|
|
|
|
One way could be that you create Comparison(T) method (or create comparer class and implemet IComparer) and use that for sub lists Sort parameter. Instead of comparing which one of the attributes is greater, use your main list to make the decision.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Please Help me, how can i build Software like "Privacy Guard"(its new name is "Hide Your IP Address / Version 1.0") in "C#"
|
|
|
|
|
It's like eating an elephant. You have to do it in small pieces.
|
|
|
|
|
First, catch an elephant...
|
|
|
|