|
mironos wrote:
("daily" + i).Items.Add(person);
That won't work.
You'll have to use the Controls collection on the Form to refer to the controls your after, such as
If( this.Controls[ index ].Name == 'something' )
or something close to this. You'll also probably look into checking the type of control too.
RageInTheMachine9532
|
|
|
|
|
i searched alot for free source code for router configuration commands simulator and i didn't find any thing could you help me to find it as soon as possiple ....
:|i need a code running under windows not any OS else
Thanks
mbd
|
|
|
|
|
route add .. .. ..
how about you ask relevant questions for C#?
Do yourself a favor and install linux and you will have all the source code you ever need.
top secret
|
|
|
|
|
I have a program that interfaces a access database. I made the adapter and have a connection to it. I can view the schema and all. However for some reason the below code is not allowing me to insert a new roll and can't figure out why. Based on what i read on msdn this looks correct.
Thanks for the help.
private void button1_Click(object sender, System.EventArgs e)
{
oleDbDataAdapter1.Fill(dataset);
DataRow Insert = dataset.Movie.NewRow();
Insert["Title"] ="testing";
dataset.Movie.Rows.Add(Insert);
Controls.Remove(this);
this.Hide();
}
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
You need to call Update on the DataSet in order for the changes to be persisted back to the database.
Charlie
if(!curlies){ return; }
|
|
|
|
|
I do have a question though maybe you or someone else can answer this.
In my access database. I have a field called Information. I set it as type memo so its 65,535 in length. I took and changed the maxlength on my textbox to that size. However. Whenever I type in the box without hitting enter. Everythign looks fine but when i query the database i get only maybe a line an a half of whatever i type. Its not even close to 65,535. Any idea would could be causeing the data to truncate like that?
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
If you are using Query Analizer (comes with the SQL install), then it is just the default behaviour of the client. It is not showing you the actual text on the DB. I don't have a database to bring mine up on right now, but there is some option you set which defines how much text it should grab on a query.
___________________
Forgoing antagonism and separation, one enters into the harmonious oneness of all things. Lao Tzu
|
|
|
|
|
I have made a neat little app that does lookups in Active Directory based on information entered. So far, i have had great success with literal strings, but i was wondering how, using DirectorySearcher (in C#), that i can do searches on partial strings.
Example: Right now, if i search on extension 12345, i get a row returning the user with 12345., and when i click on him/her, it returns all of their information. i would like to make it so if i did a search on 123, all entries with the 123 string in their properties would return.
Or, if i put in jd for username, i will get jdoe, jderr, jdingle, nedjam, etc. I have heard there is something called "insrch" or something similar that can do this, but cant find anything specific.
Yes, I am the highly suggestable type.
|
|
|
|
|
Use (sn=*123*) . I know 123* would be a valid filter in AD; I assume *123* would work as well.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I gave it a shot. The upside, it didnt generate any errors. The downside, with the * in place, it also doesnt return anything on the searches.
Yes, I am the highly suggestable type.
|
|
|
|
|
Try it without the preceeding asterisk and keep the trailing asterisk. I have a couple Exchange policy filters that use this notation to filter users and groups and it seems to work fine (it uses Active Directory). If not, I don't know what to tell you. I guess search the Active Directory documentation on MSDN[^] and see if there's anything in there about it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
You, sir, are a saint. It worked perfectly ;)
Yes, I am the highly suggestable type.
|
|
|
|
|
Hello people, how are you?
Does anybody knows how can I hide a tabPage in a TabControl?
For exemplo:
tabControl1.TabPage[1].Visible = false;
If anybody could help me, I would be glad...
thanks
André.
|
|
|
|
|
Just remove it - it doesn't mean you have to dispose of it:
tabControl1.TabPages.RemoveAt(1); Later, you can "show" it again by inserting it back in:
tabControl1.TabPages.Insert(1, tabPage2);
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a C# dialog app, and haven't realized until now that I want to translate it that some of the auto generated *.resx files aren't compiled into the output. (!) I haver verified the build type for them, I have looked into the .csproj file and found nothing unusual.
I have also tried compiling the resx file with the resource compiler which worked right.
I would need help on this, or I can't proceed with my project.
Thanks in advance.
|
|
|
|
|
Found the problem! (after several hours)
The problem was that I had a namespace included in "the wrong place".
Basically, I had a little util class in a different namespace in the dialog file. Therefore the compiled resource would be named after the util class, which was topmost in my source file. (!!) So to solve the problem, I only had to move this little bugger to the bottom of the .cs file.
Ugly! design of Visual Studio I'd say.
|
|
|
|
|
It has nothing to do with VS.NET. If you instantiate a ResourceManager using the constructor that takes a Type , the namespace and class name are used to resource the .resources file. The is how the .NET Framework works and is documented. If you move classes or organize your files incorrectly in your project in VS.NET, this would be an issue that you've created.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
It has nothing to do with VS.NET. If you instantiate a ResourceManager using the constructor that takes a Type, the namespace and class name are used to resource the .resources file. The is how the .NET Framework works and is documented.
IMO its VS.NET inserting namespaces et all into resource names that are "incorrect" behaviour. Adding a resource via command line will not prepend anything to the filename.
top secret
|
|
|
|
|
Well, IMO its VS.NET doing what IDEs are typically for - making the life of coders easily. If you organize your projects into "folders", the default namespace of a source file uses that prepended with the default namespace configured in the project. If you add ResX files to that, the same thing happens, keeping with consistent behavior. This is especially important when adding ResX files to be scoped with the fully-qualified class name.
If you don't want VS.NET doing things for you - or any IDE for that matter - use the command-line tools. I typically do when I need something quick and don't want VS.NET automating tasks such as this.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
If you don't want VS.NET doing things for you
Being able to disable this behaviour would be nice...
top secret
|
|
|
|
|
I'd like to get all of the available "Save As" formats for my installation of Word...I've tried a couple approaches with overlapping results...
foreach(Word.FileConverter FileCon in WordObj.FileConverters)
{
if(FileCon.CanSave)
cbConvertFormat.Items.Add(FileCon.FormatName);
}
The above code gives the mode formats but it does not include HTML,RTF, Word etc...
Anyone have a way to get a complete list of converters available?
|
|
|
|
|
I would assume those "converters" are built into Word itself and are not pluggable converters, especially the Document saving capability. I mean, what good is Word if it can't save Word Documents? And with all the HTML capabilities they've added with 2000 and up, it would be no surprise that it's all part of the base functionality, especially since the automation model supports a lot of HTML-related methods and properties.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a windows service that polls an "email" message queue. The queue contains serialized email and attachments objects. If a message is in the queue, it is read, deserialized and placed into a MailMessage and sent through the SMTP Service.
To do this, I use a ThreadPool to spawn n threads every n seconds. I employ extensive logging and error catching throughout. If an error occurs, a timeout receiving a response, for example it is logged and processing continues. This all works great, sends 1000's of messages until...
a certain type of error occurs, namely when the smtp server cannot be reached for whatever reason. This error for some reason causes the ThreadPool loop to terminate. Below is the code. If anyone can see why the loop would terminate, please advise.
public void StartListening()
{
_QueryStopEvent = new ManualResetEvent(false);
_StopCompletedEvent = new ManualResetEvent(false);
_Constants.BaseKey = "EmailQueue";
_PollTime = 200000;
_TimeOut = 5000;
_Threads = 5;
_Host = www.smtphost.com;
_Port = 25;
_LogPath = "C:\LogFiles\";
_StopCompletedEvent.Reset();
do
{
AutoResetEvent[] aCompletedEvents = new AutoResetEvent[_Threads];
for (int i = 0; i < _Threads; i++)
{
aCompletedEvents[i] = new AutoResetEvent(false);
EmailGenerator oGen = new EmailGenerator(_Host, _Port, aCompletedEvents[i], i, _BaseKey);
oGen.Start();
Thread.Sleep(1);
}
WaitHandle.WaitAll(aCompletedEvents, _TimeOut, false);
}
while (_QueryStopEvent.WaitOne(_PollTime, false) == false);
_StopCompletedEvent.Set();
}
|
|
|
|
|
I can set my Parent Window for my C# windows application using the unmanaged Windows API SetWindowLong function. But I am trying to avoid all unmanaged code. If I set my form's property TopMost = true; then I can obscure any Modal dialogs my "desired" Parent Window pops up and get into a locked up circumstance, because the user can't respond to the Modal dialog. If I leave TopMost = false;, then I am all or partially obscured by my "desired" Parent Window.
|
|
|
|
|
The SetWindowLong function documentation specifically warns against using it to set the parent of a child window. Use SetParent instead.
What are you attempting to do anyway?
RageInTheMachine9532
|
|
|
|