|
Thank you very much.i did not see that
|
|
|
|
|
i filled the dataset but it is still doing the same thing.
Anything else i'm missing???
|
|
|
|
|
It seems that you want to fill the same dataset in both the queries. Are you sure you are using the correct overload of Fill()[^] method.?
|
|
|
|
|
yes I want to Fill thesame dataset so that the comparison can be done and then create a third datatable
|
|
|
|
|
I am still foggy on this concept. Let me explain what I grasp (or think I do) so far. I will use this code as reference:
class TestClass
{
private int privVar = 5;
public int PubVar = 3;
}
(I know I am missing some code, but Im trying to keep it simple)
A private instance variable can only be modified within the class it was declared in. Or, within the method it was declared in.
A Public instance var has the same rules but also can be accessed by using it this way:
TestClass testClass = new TestClass();
int x = testClass.PubVar();
All of the books and articles I have read say that using public instance variables can be dangerous. Its not that I dont believe them, I just dont understand where the harm lies. In my current view, it seems like a person would have to instantiate your class by accident somehow, then use the testClass.PubVar(); (or w/e they named it) without know it is yours and not theirs?
Maybe because I am still learning C# and dont know of other ways that you can harm your variable? The reason why I bring this up now is because I am taking on the Get() and Set() methods, and the logic behind them is really confusing me.
I hope I am being descriptive enough of my problem, I was hoping to avoid a huge wall of text but maintain as much clarity of my question as possible.
Thanks
|
|
|
|
|
It can be "dangerous" to expose your class variables to the public, because your class has no idea that the outside world has changed the value.
If your class needs to know that the value has changed, then it's best to wrap it in a property, so you can add extra logic in the set method to deal with the new value.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
I would suggest you look up encapsulation and/or information hiding to read about this. I'd add a link to wikipedia, but I didn't think the article there was too helpful - Google should suffice though.
Hope this helps,
Chris
|
|
|
|
|
can someone help me, need it badly.
|
|
|
|
|
I have an application that contains a dataset with a few datatables. I have a few .csv files that I'd like to load into the datatables. Can that be done? If so, how?
Thanks!
|
|
|
|
|
Open the .csv file with a StreamReader, read each line, then do a String.Split on the
commas (do this for each line).
Then insert the rows into the database.
Cheers,
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
Thanks for your quick response! The CSV file is pretty big, it has approximately 15,000 rows of data. Is that the most efficient way?
Thanks!
|
|
|
|
|
Its the quickest way that i'm aware of. If your only doing it once or twice, time shouldn't be an issue, it'll be done before you can get a coffee...
Cheers,
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
Does it have ot be done using code?
Otherwise, assuming you are using Sql, right click on the db, select Tasks > Import data and follow the wizard
|
|
|
|
|
Hi, A few weeks back i found a good article here on CP to do with running a new process from within your own form. It was as if the form was redirecting graphical output and input to the process.
Basicly, the form opened, and the process you defined (iexplore.exe or notepad.exe) would open and run from within your form, not in their own.
At the time i bookmarked, but i have had to reformat and lost all my bookmarks.
I spent over an hour thismorning, and just spent another hour looking through all the C# articles for this one.
I was wondering if someone knew what i was talking about and could point me in the right direction?
|
|
|
|
|
|
Ah my friend you are yet again my saviour.
Thank you. Yeah i love your windows tabbifier, i already use it on my computer, helps keep applications tidy.
But the second link is the exact article i was looking for.
Thank you so much.
|
|
|
|
|
Glad to help you Nice to hear that you are using my app If you have any suggestions please post them at the article. By the way, you could have found the article you were looking for in the references of my article
|
|
|
|
|
Yeah its an awesome app, normally i would just code my own using yours as a base but yours has all you could need just to keep things tidy when your running alot instead of the built in Taskbar grouping in XP.
If i come up with any suggestions ill let you know
Ohh its referenced in your app! Now i remember, thats how i found it in the first place!
|
|
|
|
|
I'm trying to Export info of datagridview to Excel or Word to save it.
Can someone help me on this issue
|
|
|
|
|
A simple search congaing words from the title of your post will bring Lots of results.[^]
|
|
|
|
|
Hi All,
I am new here
I have the following scenario:
I need to add an image to an existinf imagelist (winforms)
so simple- but so complicated/
The imagelist is defined with image size 16*16, colordepth- 16...
every action on the imagelist- addition, removal- raises a message: the image could not be added to the image list. (Also when trying to remove an image- not ADD! BUG or something in the resx is curropted?))
If I increase the depth to any higher numbver: I could add\ remove- but the picture are not as should- cut at thr rightsize.
So---
Treying to save the images to files- craete a new image list and so on (We do not have the actual files)- but upon saving- the images are curropted- in any format- bmp, gif etc...
Any help will be appriciated! thank you very much.
(.Net 2003 1.0)
Thanks!!!!!!!!!!!!!!!!!
|
|
|
|
|
How can I filter the following dataTable that is the datasource to a datagridview:
dtMenu has the following fields:
MenuID - typeof(int),
DayOfWeekServed - typeof(DateType),
ChefID - typeof(int)
MenuID links to the dtMenuItems table which has the following fields:
ItemName - typeof(string)
IsLowCarb - typeof(bool)
Description - typeof(string)
...etc
I want to configure the dtMenu where the user can filter the menu items based on whether the item is LowCarb or not. (There are other usages but this is the simplest example)
I know I can do a database query but I want to filter the records from the two in-memory dataTables. My problem would be solved if the datagridview would accept an array of datarows.
Thanks to anyone who can preserve my shrinking ego!
Richard
I've used up all my sick days, so today I'm calling in dead.
|
|
|
|
|
DataView dv = new DataView(yourDataTable, "IsLowCarb=1", string.Empty, DataViewRowState.CurrentRows);
Bind your DataGridView to the dv.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
I am writing a little timer program to control usage of computers in a computer lab i work in. I have two text boxes. One for the index number of the user and the other for the password. If the user presses tab key, the screen flickers.
this is the code i use for the full screen
private void mainLab_Load(object sender, EventArgs e)
{
this.Size = SystemInformation.PrimaryMonitorSize;
this.Location = new Point(0, 0);
intLLKey = KeyBoardHooker.SetWindowsHookEx(KeyBoardHooker.WH_KEYBOARD_LL, hooker.LowLevelKeyboardProc
, System.Runtime.InteropServices.Marshal.GetHINSTANCE(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0]).ToInt32(), 0);
//topmost
this.TopMost = true;
//activate
this.Activate();
}
I also have a system hook which i use to disable the windows key and other special keys. I am running the program on the limited account i have created. I used windows steady state to disable task manager. However if the user continuosly presses the ctrl+alt+del the program crashes and exits.
And last but not least i used a windows service to start the program.
|
|
|
|
|
hello every body
i want ask how can i make user to chang the configuration of app.config in runtime
example:
i will put textbox for enter the name of database server
and iwant take this value and put it in app.config in <connectionsstring>
section
thanx for ur time and iam waiting 4 ur help
|
|
|
|