698 Posted Topics

Member Avatar for varshanar

It depends on what you want to acheive and why. You can't directly include vb.net code in a C# project. You can access teh vb code FROM your C# project in a couple of ways. How large is the vb.net page and do you use it in vb.net projects? The …

Member Avatar for Geekitygeek
0
128
Member Avatar for Hardz

Unfortunately the wildcard symbol (%) is only allowed at the start and/or end of the filter string. You would need to implement your own logic to apply the filter the way you have stated. Something like: [CODE] string Value = "M a"; string filter = string.Empty; if (Value.Contains(" ")) //check …

Member Avatar for Hardz
0
368
Member Avatar for penguin22

pritesh...what you have suggested is completely wrong. HOW he used the '/' is absolutely right, it was WHERE he used it that is the problem. If EntryID is a numeric data type then it should not be enclosed as a string. The '/' is an escape sequence that ensures the …

Member Avatar for penguin22
0
155
Member Avatar for IDC_Sharp
Member Avatar for Geekitygeek
0
69
Member Avatar for IDC_Sharp

You need to obtain a reference to form 1 within form 2. Check out [URL="http://www.daniweb.com/code/snippet298708.html"]my new tutorial[/URL] to see how you can create the reference and then use it to access controls on another form.

Member Avatar for Geekitygeek
0
71
Member Avatar for empyrean

You need to add items to the SelectedItems collection rather than chanign the single SelectedItem value: [CODE] foreach (object item in listBox1.SelectedItems) { listBox2.SelectedItems.Add(item); } [/CODE]

Member Avatar for Geekitygeek
0
3K
Member Avatar for GAME

Hi GAME, the policy here at daniweb is to help those who help themselves. nick.crane has outlined the process you need to follow; write a method which iterates through the forms stored in the MDIParent's MDIChildren collection and sets the location and size for each form according to your desired …

Member Avatar for nick.crane
0
157
Member Avatar for empyrean

check [URL="http://www.daniweb.com/code/snippet298708.html"]my new tutorial[/URL] since this seems to be a common problem :)

Member Avatar for empyrean
0
85
Member Avatar for Medalgod

You need to use the KeyUp and KeyDown events. The shift key doesnt fire the KeyPress event. The KeyUp and KeyDown events have an e.KeyData property which will hold a value you can check against the Keys enumeration: [CODE] if(e.KeyData== Keys.ShiftKey) [/CODE]

Member Avatar for Geekitygeek
0
155
Member Avatar for jacg4

Im not aware of a standard control that offers this functionality. There may be something in WPF or a third party control you could use. Alternatively you can add this yourself fairly easily using a timer. Add a tiemr to your form and in its Tick event reduce the size …

Member Avatar for jacg4
0
119
Member Avatar for neo.mn

You can also attach your project in a zip file by clicking Use Advanced Editor and then the paperclip "attachments" button and adding the file. Then anyone can view your code and attempt to help you. This is a community site, where we all work together to solve problems and …

Member Avatar for Geekitygeek
0
108
Member Avatar for EmmaH

finito is right, you need to actually multiply the number BY something. Is it possible you got confused by the alternative syntax of [iCODE]number*=number[/iCODE]? If you are operating on the same variable that will store the result you can use this as a shorthand. For example: [CODE] int number; number …

Member Avatar for finito
0
132
Member Avatar for neetika reddy

Your second condition will never be true, you need to swap them around. The if statement starts at the first condition and works its way down until one matches. In your case if DDLDepartment.SelectedValue is not null it will match the first. The only way your else statement will be …

Member Avatar for Geekitygeek
0
399
Member Avatar for virusisfound

finito and farooqaaa have it right between them. If you want to access members of Form1 from Form2 then Form2 needs to contain a refernce to Form1. Use the code he showed you to pass a reference in Form2's constructor. However, it is bad OO to directly access a member …

Member Avatar for lotrsimp12345
0
273
Member Avatar for edgias

arunkumars, what purpose does [icode]Login lg = new Login(); lg.Close();[/icode] serve? You create the form, run its constructor then dispose of it? If you were trying to obtain a reference to the existign Login form and close that one, this is not the way to do it. Since it seems …

Member Avatar for Geekitygeek
0
99
Member Avatar for darkocean

You have answered your own question really; each port needs to operate in its own thread. The only way you can have your application monitoring and answering on all the ports concurrently is to use a threaded approach. There are numerous tutorials and articles about threading...[URL="http://msdn.microsoft.com/en-us/library/aa645740(VS.71).aspx"]google[/URL] [URL="http://www.albahari.com/threading/"]is[/URL] [URL="http://www.yoda.arachsys.com/csharp/threads/"]your[/URL] [URL="http://www.codeproject.com/KB/cs/ThreadsinC_.aspx"]friend[/URL].

Member Avatar for darkocean
0
2K
Member Avatar for sivak

SQL?? SQL is used for database queries...are you sure thats what you need?

Member Avatar for arunkumars
0
85
Member Avatar for lotrsimp12345

the extra backslash is an escape character; it is used at the start of an escape sequence. An escape sequence is a series of characters which the compiler reads and converts into somethign else. For instance \n becomes a newline character. To tell the compiler that the '' is to …

Member Avatar for Geekitygeek
0
824
Member Avatar for virusisfound

The inputbox is language specific and is not a feature missing from "VS" but the "C#" language. It is very easy to roll your own input box in C# which is something i did a while back and reuse. Just create a form with a label, a textbox and your …

Member Avatar for virusisfound
0
709
Member Avatar for ayeshakhan

Firstly, please use [noparse][code][/code][/noparse] tags when posting code to preserve the formatting and make it readable. As to your problem, i believe it stems from calling cmd.ExecuteReader() twice. You load the data into your SqlDataReader, check it has rows then try to get the dataset again. You already have the …

Member Avatar for ayeshakhan
0
144
Member Avatar for Acidburn

The UI thread cannot be directly accessed by other threads. You have invoke a delegate to perform the changes on the UI. Theres an example [URL="http://blogs.msdn.com/b/csharpfaq/archive/2004/03/17/91685.aspx"]here[/URL].

Member Avatar for nick.crane
0
213
Member Avatar for octavia

You can disable that shortcut in the registry. Theres a post that shows you how to do it [URL="http://tamaspiros.co.uk/2007/12/20/c-disable-ctrl-alt-del-alt-tab-alt-f4-start-menu-and-so-on/"]here[/URL] although this kind of thing always feels a little to "nasty" for my tastes : / Im sure its just me, there must be SOME genuine reason for preventing your user …

Member Avatar for Lusiphur
0
406
Member Avatar for Mattisc

If you want to use the loop approach then you should use a loop in your code. At the moment your code basically does this: Create file 0. If file 0 doesnt exist, increase loop and create file 0. (EDIT) Clearly not what you were aiming for. If you are …

Member Avatar for Geekitygeek
0
188
Member Avatar for udigold1

You have two choices. You can pass a reference to Form1 into Form2 in its constructor to allow you to pass the data back, or you can add a Result property to Form2 which you read from Form1 in order to update the status. Solution One Example: [CODE] public partial …

Member Avatar for Geekitygeek
0
1K
Member Avatar for Mattisc

Check your Output window in VS; Unless you have manually created the folder "C:\new2\newnew" you may find you have some entries that read "A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll" As nick.crane suggested, you need to re-examine your logic and your path strings...if you have the paths …

Member Avatar for Mattisc
0
558
Member Avatar for neetika reddy

Use nullable search parameters in your sql query: [CODE] declare @id int = 1 declare @Name nvarchar(20) = null SELECT * FROM Products WHERE (@id is null OR Products.ProductID = @id) AND (@Name is null OR Products.Name = @Name [/CODE] By making the search terms nullable and checking for null …

Member Avatar for Geekitygeek
0
154
Member Avatar for ayesha25

At 20 days old, i'm not sure it was worth resurrecting this thread to have it marked solved

Member Avatar for Geekitygeek
0
152
Member Avatar for IDC_Sharp

What you are creating here is a parent child relationship between the two forms. When you create Form2 WITHIN Form1, Form2 is the child, Form1 is the parent. A word of Caution; whilst creating a child form then closing the parent form will often work...it is not good design practice …

Member Avatar for Lusiphur
0
210
Member Avatar for sadhawan

Google is your friend :p [URL="http://en.wikipedia.org/wiki/Sharable_Content_Object_Reference_Model"]SCORM[/URL] or the [URL="http://www.scorm.com/"]Home of Scorm[/URL]

Member Avatar for sadhawan
0
92
Member Avatar for AngelicOne
Member Avatar for Mattisc

You have a couple of choices. You can store the current file number somewhere so you can resume from that number, or you can loop through the numbers until you find the lowest that doesnt already exist. If you do the first you need to decide the scope of the …

Member Avatar for Geekitygeek
0
108
Member Avatar for judithSampathwa

if you want an easy way to disable all of the controls you can group them together inside a panel. Set the panel's Enabled property to false and all of the controls inside it will be disabled too. If you leave the button outside the panel it will be uneffected. …

Member Avatar for Geekitygeek
0
76
Member Avatar for wolfje

Hi, When you say you want to check if they have been "stored more than x times", do you mean in the arraylist? If you are only allowing values to be stored if they havent been used then this check is redundant (unless you plan to populate the arraylist with …

Member Avatar for Geekitygeek
0
97
Member Avatar for buddy87

insert a breakpoint and debug to check what controls are present in this.Controls

Member Avatar for ddanbe
0
72
Member Avatar for Mattisc

File.Copy or File.Move only work on a single file; you cannot specify "*" to get all files. If you want to move all files then you need to iterate through them manually: [CODE] DirectoryInfo source = new DirectoryInfo(@"C:\new1\"); DirectoryInfo destination = new DirectoryInfo(@"C:\new2\"); foreach (FileInfo file in source.GetFiles()) { file.MoveTo(Path.Combine(destination.FullName, …

Member Avatar for swagerr
0
1K
Member Avatar for Mattisc

Please refrain from posting duplicate threads. I have answered your problem in your [URL="http://www.daniweb.com/forums/thread297665.html"]original question[/URL].

Member Avatar for Geekitygeek
0
83
Member Avatar for virusisfound

[QUOTE=GDICommander;1279694]Just put a try-catch with the correct exception, FormatException try { //Convert text boxes } catch (FormatException e) { Console.WriteLine("Invalid text in boxes!"); }[/QUOTE] An alternative to throwing an exception would be to utilise the TryParse method: [CODE] int a; if (int.TryParse(textBox1.Text, out a)) { //success. Do work } else …

Member Avatar for Geekitygeek
0
137
Member Avatar for bhavna_816
Member Avatar for Geekitygeek
0
312
Member Avatar for trippinz

When you say you have it repeated in ALL of the textchanged events do you mean something like: [CODE] private void textBox1_TextChanged(object sender, EventArgs e) { string l_text; l_text = textBox1.Text; l_text += textBox2.Text; l_text += textBox3.Text; ... } private void textBox2_TextChanged(object sender, EventArgs e) { string l_text; l_text = …

Member Avatar for Geekitygeek
0
149
Member Avatar for lotrsimp12345

Depending on how many forms you'll be working with and whether you want to maintain their state when moving between them, you could keep a List of the forms visited. If you want to maintain their state then (eg values in controls, changes made, etc) and you are using relatively …

Member Avatar for Geekitygeek
0
237
Member Avatar for mabshell

Agreed...ArrayList stores objects, if you want to use an ArrayList you will have to unbox them before using them: [CODE] //assuming you only store integer values in the arraylist if ((int)vector[j] > (int)vector[j + 1]) { int aux = (int)vector[j]; [/CODE] alternatively, as ddanbe suggested, if you only store the …

Member Avatar for Geekitygeek
0
95
Member Avatar for drugoholic

If i have understood correctly you want each gridview to be shown when you click one of the nav buttons. You can do this with a TabControl; place each datagrid in a different page then show/hide the tab pages when the buttons are clicked. This is propably the simplest method, …

Member Avatar for Geekitygeek
0
104
Member Avatar for zack_falcon

Just so you know..the reason you were getting the error is because [iCODE]Image.Equals(object)[/iCODE] is used to determine if the current image object is equal to the object specified in the paramaters. ie, [iCODE]PicBox1.Image.Equals(bitMap1)[/iCODE] will return true if PicBox1.Image and bitMap1 are equal. In this sense 'equal' means they have the …

Member Avatar for Geekitygeek
0
211
Member Avatar for GAME

You are passing in a filename as a string where the method signature expects a stream value. Either change the method to: [CODE] private void Blah(string path) { Stream s = new Stream(path); } [/CODE] Writing on the fly here so apologies if the stream syntax is off. Basically pass …

Member Avatar for Geekitygeek
0
121
Member Avatar for Candee89

I think you may have misunderstood the concept of pseudocode...you have the right idea, that non-programmers can read it and understand it, but that isnt its purpose. The idea is to write the pseudocode BEFORE you write your code. You use pseudocode to get a view of the flow of …

Member Avatar for Lusiphur
0
278
Member Avatar for Zinderin

Globals are a bad OO design, C# is an OO language. The module in vb.net is just a neat trick the compiler offers. The modules are basically just sealed classes with all their members declared as static. You can do the same yourself, you just don't promote the member names …

Member Avatar for Geekitygeek
0
145
Member Avatar for Nivass

When you zoom the image are you resizing the picture box to fit or is part of the image hidden outside the container?

Member Avatar for Nivass
0
3K
Member Avatar for sadhawan

I'm not sure what it is you are trying to achieve : / That isnt Java script..its a segment of html. What are you trying to m,atch with your regex? Post some code so we can see what you're trying to do

Member Avatar for sadhawan
0
154
Member Avatar for Duki

I noticed you use [icode]xlBook = xl.Workbooks.Open[/icode]; i'm certain i read somewhere that a general rule of thumb is two avoid "double dots" when using COM objects. When .net calls the com objects it creates a wrapper which ends up something like: [CODE] WorkBook xlBook; WorkBooks tmp; tmp = xlApp.Workbooks; …

Member Avatar for Duki
0
459
Member Avatar for Duki

for (loop=0; i < MAX_TRIES; loop++) should be for (loop=0; [COLOR="Red"]loop[/COLOR] < MAX_TRIES; loop++) right? :)

Member Avatar for Duki
0
218

The End.