|
I have, but now I want to duplicate it several times within the project, but using different names for each copy. I'm thinking I might be able to get away with building the project now, then adding "existing items" from the project folder and giving them new names. Will that work?
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Sounds dreadful... maybe you're looking implants[^].
|
|
|
|
|
Your Implant idea is excellent, but I've already done what I added to the original post. Easy stuff, and no tedious retyping. Change the text in the labels, drag 'em around a bit, file off the serial numbers and, voila! A new control is born.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
I have a treeview that I populate with data from various tables in mysql db. I also update the tables based on user actions. I was wondering, is it more efficient to use a mysqlDataAdapter for this or just CommandText and MySql Reader for populating and then separate CommandText statements for updating?
|
|
|
|
|
A reader done right is usually, almost always, faster than a data adapter, dataset solution. In the cases where timings show a data adapter executing faster there is usually a flaw in logic. Where the Data Adapter and data set solutions are usually faster is in Dev/Time not run time.
|
|
|
|
|
|
While I wasn't looking for an answer to that question, it will certainly come in handy for a project I'm working on - one of several. Thanks!
Is not a reader a one-way solution, though; that is, for reading from a database in one direction? And a data adapter is more of a random access solution? Such additional overhead would certainly explain the performance difference.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
A common misconception. ADO.NET is exclusively a fast-forward, read-only cursor. The data adapter uses a data reader behind the scenes to get the data. What the data adapter does is attempt to infer the schema from the available result sets and then read to the end of all cursors populating a data set. You then get your data in a handy data set with associated overhead.
AFAIK there is not an ADO.NET solution intended to maintain an open cursor to the DB at all.
|
|
|
|
|
with associated unnecessary overhead
|
|
|
|
|
Back to the books...
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
DataReaders underly all ADO.net access; including ExecuteScalar, ExecuteNonQuery, and DataAdapter.Fill and .Update
Learning to use them effectively will make you a better developer. And chicks dig it.
|
|
|
|
|
PIEBALDconsult wrote: And chicks dig it
Well, that's good enough for me!
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Avoid DataAdapters for real work; their only purpose is to allow MS demonstrators at launch events to produce a barely-working program in the time allowed.
|
|
|
|
|
thanks for all the info. I've been using DataReaders so far and just came across the adapter. So I'll stick with the reader.
|
|
|
|
|
Hello,
I try to find how to set the property " User must change password at next log on " and i don't found.
somebody knows how to change this property ?
ThankYOU !!
|
|
|
|
|
See the "Where Password Attributes Reside" section at this[^] page.
/ravi
|
|
|
|
|
I forgot to say , i develop by using c# .
NOT VBS.
|
|
|
|
|
How about this[^] article?
/ravi
|
|
|
|
|
So what? The concepts don't change just because the programming language did.
Or were you looking for copy'n'paste code?
|
|
|
|
|
The function and how to set the the property is difrent ..
|
|
|
|
|
No, it's not. The exact same concepts and procedures still apply. The only difference is you use the classes in the System.DirectoryServices namespace to do the searching and manipulation. If you understand the concepts behind that VBS code, it's very easy to figure out how to write the equivilent code by reading the documentation on System.DirectoryServices classes and looking at the examples there.
Research is the number one skill you MUST have in order to survive writing code for a living...
|
|
|
|
|
sure he wants copy'n'paste
|
|
|
|
|
In the code below why does the created test object use the variable x from the A class when using medoth PrintString? (As I thought the x in B class would overrided the x in A class even though the A PrintString was being used) How could I make the code use the x variable from the B class? do I have to put a version of the PrintString method in the B class?
Thanks in advance.
Rapier-503
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Test_Inheritance
{
class Program
{
static void Main(string[] args)
{
B test = new B();
test.PrintString();
}
}
class A
{
string x = "Hello1";
public void PrintString()
{
Console.WriteLine(x);
}
}
class B:A
{
string x = "Hello2";
}
}
|
|
|
|
|
The short answer is "Yes".
The long one takes more explaining.
When the compiler looks at A.PrintString, it looks for a variable called x in the following places:
Local variables to PrintString
Method parameters to PrintString
Local instances of class A (this.x)
Static variables in class A (A.x)
Base classes for class A
When it find it, it compiles it to use that exact instance. It does not assume that it should look for an instance in a different, but related, class because it does not know until run time if this will be an instance of A or B (or of B passed as an A to a method).
If you want to access B.x in PrintString, then you must override it in class B to provide that functionality.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Thanks for the reply.
What I was trying to do was :-
A class has lots of members M1, M2 ..... M20 that use variable x.
B class need to do the same processing as M1... M20 but on a differnt value of x.
I didn't want to dulpicate all the M1...M20 code in B.
I must be not approaching this in the right way?
Any advice on how I should be doing this?
Thanks in Advance,
Rapier-503
|
|
|
|