|
the user suplies me with say 5 tables all schemas are identical, I want to take all the rows from the 5 tables and crew a new single table containg all the rows from the 5 tables so as i end up with one single table(then not interested in what happens to the original 5 tables) As I need to end up with dst.writexml with only one table being printed and not 5 as i can use that in my crystal report.
|
|
|
|
|
lets say that they are in an array :
DataTable[] tbls = new DataTable[5];
DataTable final = new DataTable("All");
for(int i=0;i<5;i++)
{
foreach(DataRow r in tbls[i].Rows)
{
this.final.Rows.Add(r);
}
}
Hope that helps.
|
|
|
|
|
I want to create an Access database on my PocketPC (WinCE4.2, PocketPC 2003 OS). Then using C# to populate tables, query tables, ...
From a simple search on Google.com I find that I must use ADOCE.NET but I didn't succeed to download it and also didn't see any control that I can use from Visual Studio 2003 (I created a project for Smart Mobile Device).
Is there any one has experiences doing such kind of work?
Best regards,
A. Riazi
|
|
|
|
|
Hi,
In a interface i am using private access specifier , will compling will it give error or not, if it give error then what is that error.
thanks
|
|
|
|
|
NO! its not allowed to put any access modifier behind function defination in interface, be it private, public, protected or internal.
Ali
|
|
|
|
|
Using a private in an interface is illogical.
The private specifier is telling the compliler that the method/property/field is accessible to ONLY other members of this specific class. As interfaces have no implementation nothing could ever use something declared as private within an interface.
As a general note: Interfaces are definitions for part of an exposed parts of a class so that other code can see that a class implements an interface and therefore know that it can call certain methods or properties even if it knows nothing else about the class.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Hi,
if two methods having same signature but different return type then also we can say that is overloading?
Example:=
int sum(int x,int y)
{
//some code
}
string sum(int x,int y)
{
//some code here
}
Plz tell me, thanks
|
|
|
|
|
In my views, yes we can say this 'Overloading'
Ali
|
|
|
|
|
|
mowli wrote:
if two methods having same signature but different return type then also we can say that is overloading?
Computer says no.*
This is not valid because the compiler won't know what method implementation to run.
Consider the following call:
Console.WriteLine("{0}", sum(1,2)); Which of the two methods should it call? Console.WriteLine can accept an int or a string here, so the compiler wouldn't know what to do.
If you try and run this you will get a compiler message along the lines of "myClass already defines a member called 'sum' with the same parameter types"
* As you can tell, I've been watching Little Britain recently.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
I have a dataset that I read from an xml file using
DataSet.ReadXml(fs);
I then add to the dataset and rewrite the xml file using the following:
DataRow newrow = mf.quotesDataSet.Tables["quote"].NewRow();<br />
newrow["thequote"] = quoteInput.Text;<br />
newrow["speaker"] = speakerInput.Text;<br />
newrow["origin"] = originInput.Text;<br />
newrow["image"] = "test.jpg";<br />
mf.quotesDataSet.Tables["quote"].Rows.Add(newrow);<br />
mf.quotesDataSet.WriteXml(fw);
It does add the data, however, it adds it outside the main xml hierarchy. For example, instead of:
<rss><br />
<channel><br />
<quote><thequote>text</thequote></quote><br />
<quote><thequote>text</thequote></quote><br />
<quote><thequote>new text</thequote></quote><br />
</channel><br />
</rss><br />
it writes to the file as:
<rss><br />
<channel><br />
<quote><thequote>text</thequote></quote><br />
<quote><thequote>text</thequote></quote><br />
</channel><br />
</rss><br />
<quote><thequote>new text</thequote></quote><br />
how do I make the added rows to the dataset write into the proper hierarchy?
|
|
|
|
|
Hi all,
What is the best way to find out what dll to add to a project.
eg:- compiler says you need a namspace and reference to a dll for Server in 'Server.ScriptTimeout'.
Yes but what dll is needed?
How do you find out quickly which dll?
Thanks.
|
|
|
|
|
Hi!
How should the compiler know?
You're using a class Server , the code itself is syntactically correct, if Server is a known class, but where Server is defined cannot be determined until you tell the compiler by adding the reference.
Regards,
mav
|
|
|
|
|
Yes thanks.
But it is Catch22!
Some dll's are not install by default and you have to add the dll.
But how do you know which dll to install then add to the code with the 'using' statement.
You guys must use some tool/lookup method of finding the correct dll to reference that has the functionality that you require?
I've found http://www.dotnet247.com so far.
|
|
|
|
|
Are you referring to assemblies containing your own types or third-party components?
If they are your own assemblies, you and you alone know which types are compiled into which assembly.
If it's a third-party component, they must tell you which dll hosts which type and what to install in order for the component to work correctly.
Then you can set your reference according to this info.
But just by giving a classes name (like in your example) the compile cannot determine where to find it and which to use. You can have a zillion valid assemblies on your harddisk each defining a class Server (debug/release builds, different versions, incidental name collisions, ...). Which one do you want to use? I guess you don't want the compiler to pick one at random, do you?
To find a .NET type in assemblies you can use Lutz Roeders Reflector[^], for example.
If you need a COM reference you can use the OLE/COM object viewer available with VS.NET.
Regards,
mav
|
|
|
|
|
How can I initialize components readOnly properties at design-time?
|
|
|
|
|
Do you mean at run-time!? In design time you just select the values from the property window.
|
|
|
|
|
Thank you for reply.
I mean value initialization for readOnly properties via constructor.
But component has only two constructors (empty and with IContainer parameter).
So, components properties must have getters and setters.
To make property a readOnly at run-time I used Site.DesginMode flag in setters:
public int IntProperty<br />
{<br />
get<br />
{<br />
return intProperty;<br />
}<br />
set<br />
{<br />
if(this.Site.DesignMode)<br />
{<br />
this.intPropery = value;<br />
}<br />
}<br />
}
|
|
|
|
|
Hi,
i went for an interview, in that they asked one Question like that..
I am including one dll in to my application, then .Net sdk automatically copies that dll in to my bin folder, but i want to ristrict it from coping into my folder, can i do this? if yes how can u do that?
plz any one tell me.
thanks
|
|
|
|
|
|
Hi,Leppie
Thanks for answer, and u gave one xml site link, is it related to assemblises or not i am not understanding the code plz tell me.
Thanks
|
|
|
|
|
I guess you mean his signature...
What leppie said was that in VS.NET you can click on a reference in the project explorer to show its properties.
There's a property "CopyLocal" that controls whether the dll is copied to bin or not.
Regards,
mav
|
|
|
|
|
Hi,
What is the scope of assemblies.
thanks
aparna
|
|
|
|
|
|
I have two database one on server(oracle) and one on client(MSaccess) . I want to synchronise database beetween server and client. So I don't allow anyone to update, insert or delete on server database. How to clock a table that i want synchronise with client on server database. Help me
|
|
|
|