|
Martin# wrote: This means Memory, or not?
Yes. It also means objects that needs to be garbage collected. Not very expensive, as short lived objects are handled rather efficiently, but still.
Martin# wrote: Do you know if it's also faster? (performance profiling)
Yes. Looping through the characters is the fastest and most efficient way of doing it. Any other method will also be looping through all the characters, and additionally create objects from what they find.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks a lot!
It always make sense after reading youre posts.
Martin
|
|
|
|
|
hi
You can try this
string str="ABC.ABC.ABC";
string[] strSplited=str.split('.');
If you don't have dot in end of string then
int NoOfDots=strSplited.length-1;
otherwise
int NoOfDots=strSplited.length;
|
|
|
|
|
I have created c# desktop application and created its installation.
I want the program to run immediately after the installation of the program finishes.
Is there any way to do this?
Thanks
tandukar
|
|
|
|
|
Yeah you can do it ...
Override the function "OnAfterInstall" in installer class and get the current working folder
then type this command
System.Diagnostics.Process.Start("");
Cheers
|
|
|
|
|
<br />
int Mode = 12;<br />
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Mode="+Mode+";Data Source=|DataDirectory|x.mdb;";<br />
I have seen people ask questions about this, and i decided to help.
Liviu Catrina
|
|
|
|
|
I have a usercontrol which contains a tablelayoutpanel. The tablelayout panel contains a number of textboxes and comboboxes (showing data from a single row in a table) *and* a number of dataviewgrids (showing childrelation rows). I also have an event handler on my datatables handling the rowchange-event which saves any change in any row to the database.
All my controls shows the right data from the dataset, but only changes in my dataviewgrids gets saved. The rowchange-event handler does not get called when I change data in my textboxes and comboboxes.
I do this for binding:
((TextBox)dataControl).DataBindings.Add("Text", MainForm.theDataView, this.theDataRow.Table.TableName + "." + column.ColumnName);<br />
this.tableLayoutPanel1.Controls.Add(dataControl, -1, -1);
(the actual code is a bit more complex as I create the controls on the run based on the columns in the table. My GUI is able to show data from different tables)
What I do not get is why the data get shown through the databinding in the textbox, then why does it not get updated? Please help!!!
|
|
|
|
|
Data binding doesn't work that way.. You should implement a method to explicitly save the data back to the DataTable s using a DataAdapter. And sure the DataTable.ColumnChanged won't fire, because while editting the DataGridView the bound DataTable does change; TextBoxe s isn't the same. This event fires after ending the editting in the DataGridView , while typing in a TextBox would be like editting a cell in a DataGridView without ending the editting.
Regards
|
|
|
|
|
I am not sure I understand. I am not changing any columns at any point so I'll just assume that you mean DataTable.RowChanged?
I allready got a few dataadapters, they are used for saving the tables in the dataset back into the database. Are you saying that I need dataadapters to save the contents of my textboxes back into the dataset even if they are allready databound to that dataset?
|
|
|
|
|
When you said updated I thought of updating your Database not Dataset. Well, data binding the Textbox -as you did- should be enough. Yet, you -If I get you correctly now- shouldn't bind directly to your DataTable. Instead you should bind to a BindingSource object. This makes things simpler in my belief.
Another thing to check is to handle the events of a binding object to check for the error:
Binding MyBinding = new Binding("Text", MainForm.theDataView, this.theDataRow.Table.TableName + "." + column.ColumnName, true, DataSourceUpdateMode.OnPropertyChanged);
MyBinding.BindingComplete += TestHandlerDelegate; ((TextBox)dataControl).DataBindings.Add(MyBinding);
this.tableLayoutPanel1.Controls.Add(dataControl, -1, -1);
One more thing I made is the DataSourceUpdateMode.OnPropertyChanged , which could make a performance hit, but just for debugging purposes.
Regards
|
|
|
|
|
Turns out that I have to call DataRow.EndEdit() in the LostFocus-eventhandler on my controls. That way the editting is ended and the data is persisted.
This is normally done by repositioning in the datatable and is automaticly done by dataviewgrid.
Thanks for your time
|
|
|
|
|
hi,
i got an error message when i try to compile the code for controlling electrical devices using a pc
how do i fix dat
thnks
lawscom
|
|
|
|
|
lawscom wrote: i got an error message when i try to compile the code for controlling electrical devices using a pc
how do i fix dat
Too vague. What is the error message? What piece of code does it occur in?
|
|
|
|
|
hi,im currenly doing an application that requires that i do an autocoplete textbox like the search textbox in google,when you type a word like 'C#' it offers suggestions of words you have typed before starting with the letter 'c'.
Any of you have any suggestions,links on how to do this i would really appreciate it
i hope you all understand my question
thanks
regards paula
|
|
|
|
|
There is a built in ability in TextBox objects for auto complete. You just specify TextBox.AutoCompleteMode and TextBox.AutoCompleteSource properties.
PS.
1- These two properties are available in .Net 2.0 or later.
2- If you need more info click here[^].
Regards
|
|
|
|
|
hi,
Does anyone knows what is the LDAPDisplayName that allows me to know if the user is disabled or enabled.
Also if anybody have some information about how to edit, delete, or create users in the active directory using the LDAP and the C#.
Best regards,
Jamil
|
|
|
|
|
I didn't know yesterday... I don't know today... are you going to post the same question again tomorrow??
|
|
|
|
|
It is not ur business. Do something that is usefull and don't make your self and you replys a matter of joke.
I will keep posting till somebody knows and tell me.
jamil abou khalil
|
|
|
|
|
Hahahaha, dude.. relax... having a bad-hair-day??
|
|
|
|
|
I am having trouble in this LDAP thing and i can't solve it.
Nothing is working. Bad work, Bad planning, every thing is bad. And execuse me for that reply, but i can't hold any silly comments.
Jamil Abou Khalil
|
|
|
|
|
Allright, let's help you out then.. what exactly is your problem, cause I don't relly understand what your problem is, and what you're up to...
Do you want to retrieve all users from ActiveDirectory and be able to manipulate the users??
|
|
|
|
|
I know how to retrieve the users from the Active directory.
When i retrive the users i want to get their information and put them in a special form. I was able to get all the information i need except the one that says if the account is disabled or enabled.
In another way i made, i was able to query the active directory to get only the disabled users. But this is a very long way and if i knew the LDAP displayName of the disabled check box i can make it in one line instead of 50 or more.
The other problem is that i want to know how to create knew users and how to manipulate users. (Assuming i have administrative privillages).
Best regards,
Jamil Abou Khalil
|
|
|
|
|
LDAPDisplayName[^]
hope this can help...
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
Im using VS 2005, I have created the installer for a windows project, I need to restrict the software to 30 days.
Do I use registry settings to do so,
How?
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
I do not think the trial setting thing is an installer thing... An installer makes sure your app and all libraries that your app requires are installed on the target computer. Creating trial version functionality requires you to program a bit more knowledge in your application. Ofcourse you can set a registry value at install time, but users can then edit the value using regedit and prevent your app from neatly 'refuse to work' as soon as the trial period expires.
|
|
|
|