536 Posted Topics

Member Avatar for damirin

Assuming that [I]eval [/I]will appear as text in the source string then you can use [iCODE]source.Contains("eval")[/iCODE] to test for "eval". Note: [I]Contains[/I] does a case sensative test. So if it [I]eval[/I] could be "Eval" then use [iCODE]source.LastIndexOf("eval", StringComparison.InvariantCultureIgnoreCase)[/iCODE] which will return -1 if not found.

Member Avatar for nick.crane
0
179
Member Avatar for AngelicOne

Try adding a test for the table count. [CODE]if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { dataGridView1.DataSource = ds.Tables[0]; }[/CODE]

Member Avatar for Lusiphur
0
315
Member Avatar for Mattisc

Firstly using the @ infront of a string will mean that the \\ is illegal. Secondly, AFAIK none of the .Net file handling classes support wildcard characters in filenames so the * is also illegal. Use Directory.GetFiles to get a String array of filenames. Then perform the move on each …

Member Avatar for swagerr
0
1K
Member Avatar for Nivass

Your [I]ZoomIn[/I] method only changes the size of the PictureBox, it does not changes its [I]Location[/I]. Therefore the top left corner of the PictureBox remains where it is and the right and bottom move by the change in size. You need to adjust the [I]Location[/I] property of the PictureBox (by …

Member Avatar for nick.crane
0
245
Member Avatar for AngelicOne

Alternativley, set the forms [I]AcceptButton [/I]property to the button you want to execute on Enter. Setting the forms [I]CancelButton [/I]property will do the same thing for Escape. And setting the forms [I]HelpButton [/I]captures the F1 key.

Member Avatar for AngelicOne
0
173
Member Avatar for Candee89

Try these links. The first one has an example very similar to your code. [URL="http://www.minich.com/education/wyo/stylesheets/pseudocode.htm"]Pseudocode Summary[/URL] [URL="http://www.unf.edu/~broggio/cop2221/2221pseu.htm"]Pseudocode Examples[/URL]

Member Avatar for Lusiphur
0
278
Member Avatar for Zinderin

Hi, I have a few points that you might want to consider. If you only ever expect a single table result from the SQL query, then you can use a DataTable instead of a DataSet. The data collection part could be moved out to a private function that takes the …

Member Avatar for nick.crane
1
97
Member Avatar for like_bilal02

Changing the allow null in sql is not automatically picked up by VS designers. You need to manually change the AllowDBNull property of each column in your tables. You can do this in the dataset designer.

Member Avatar for speedcat
0
187
Member Avatar for judithSampathwa

I am guessing that you want to read a file from the computer where your app is running and store in the SQL DB. You will need to read the file in to a byte array using [iCODE]System.IO.File.ReadAllBytes("filename");[/iCODE] Then pass this as a parameter to a varbinary(MAX) column in you …

Member Avatar for nick.crane
0
629
Member Avatar for jaron1611

Take a look at [post=1273473]this post[/post]. The link there is for a CalendarColumn class. If you add the CalendarColumn class to your project it appears in the column choices in the DataGridView designer and you can bind to it just like the other column types. Note: Remember to select the …

Member Avatar for nick.crane
0
115
Member Avatar for arch_mah

[iCODE]Image.FromFile(str, k)[/iCODE] is in error. [I]FromFile [/I]only takes one parameter for the filename. The second parameter is a boolean for useEmbeddedColorManagement. Try [iCODE]Image.FromFile(System.IO.Path.Combine(str, k))[/iCODE]

Member Avatar for nick.crane
0
321
Member Avatar for srky

I suspect the OP means this. [URL="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.formview.aspx"]System.Web.UI.WebControls.FormView Class[/URL] I'm not experienced with webcontrols so perhaps someone else can help.

Member Avatar for srky
0
110
Member Avatar for veekay123

if [QUOTE]tutor failed me coz he wants me to implement my own algorithm.[/QUOTE] then have a go. If you need specific help with a problem (after showing some effort) then ask.

Member Avatar for Diamonddrake
0
75
Member Avatar for sadhawan
Member Avatar for judithSampathwa

Your regex string is looking for 4 digits inside the (). One for [1-9] and then another 3 digits with \d{3}. Change \d{3} to \d{2} and it should work.

Member Avatar for nick.crane
0
281
Member Avatar for Duki

Re lots of excel processes. Maybe you should try to use only one excel app and open each workbook using that one only. At least you will only have one open process to worry about. Re-not closing: Your thread about unreachable code had this in it [QUOTE]System.Runtime.InteropServices.Marshal.ReleaseComObject(xlBook); System.Runtime.InteropServices.Marshal.ReleaseComObject(xlSheet); System.Runtime.InteropServices.Marshal.ReleaseComObject(xl); [/QUOTE] …

Member Avatar for Duki
0
461
Member Avatar for Duki

Having this [iCODE]goto PointOfRetry;[/iCODE] inside the for loop is why you have the error. All the code beneath it (in the catch block) will never be executed. Using goto is not very good coding practice. I recommend you try to find another way; using a while loop perhaps

Member Avatar for Duki
0
218
Member Avatar for steaky1212

Provided the base class and the engine are in the same library you can use a shared interface that is private to your code only. When implementing the interface on the base class ensure that you only do this explicitly and not implicitly. You will need to cast base class …

Member Avatar for nick.crane
0
208
Member Avatar for judithSampathwa

If frmMainMenu is your main application form then closing it will terminate the application. What is the purpose of the login on form close? If your intention is to check that the user has permission to close the application then : [LIST] [*]In the close button just do [iCODE]this.close();[/iCODE]; this …

Member Avatar for Geekitygeek
0
470
Member Avatar for markthien

If there is a lot of records then this could be a timing issue. It is not recommended to do any lengthy process in form_load. Try moving the code to a seperate method and call it from form_shown instead.

Member Avatar for markthien
0
122
Member Avatar for kalpa23

If the data is in a database then do a seperate aggregate query. E.G. [CODE]SELECT SUM([PRICE]) AS TOTAL FROM MYTABLE[/CODE]

Member Avatar for arunkumars
0
186
Member Avatar for Duki

Try this. [CODE]DataTable dt = this.vehiclesTableAdapter.GetDataByID(ID_Number); dt.Rows[0].ItemArray; //<--- Returns object array of row values [/CODE]

Member Avatar for k.d.m
0
160
Member Avatar for emclondon

[iCODE]myList.Capacity[/iCODE] is the maximum items allowed in the list. Because lists are dynamic this will change as items are added. What you need to test is [iCODE]myList.Count[/iCODE] which is the number of items in the list.

Member Avatar for nick.crane
1
168
Member Avatar for khanrock

Lusiphur is using a Regex to remove the "button" text from the button name. Since your buttons have the number in the button text then you can use this instead. When ever an event fires it passes the object that raised the event in the [I]sender [/I]parameter. However, to use …

Member Avatar for nick.crane
0
120
Member Avatar for hgbreton

If the document is flat then you could enumerate through ChildNodes and process according to what you find. This might even be more efficient than doing about 100 TagName seaches with selectSingleNode. [Edit] or maybe not as you will have to have a big block of if then else if …

Member Avatar for hgbreton
0
156
Member Avatar for judithSampathwa

[I]Validating [/I]events are used to help stop the user from leaving a cell with a bad value. The EventArgs usually has a Cancel property that if set to true will block the user from leaving the data entry field (cell, textbox, etc.). They are only triggered when the user tries …

Member Avatar for judithSampathwa
0
1K
Member Avatar for judithSampathwa

Have you tried using the [I]MinDate[/I] and [I]MaxDate[/I] properties of the DateTimePicker. I know from previous posts that you want to restrict the start date to be from today onwards so to do this you can just set the [I]MinDate[/I] property of dpSdate. To get one date to be restricted …

Member Avatar for judithSampathwa
0
170
Member Avatar for golansha

If you know that the datetime is always in the same format as in your example then it will always be of a fixed length. Also, if the date is always at the start of the string then you can use String.SubString to extract the date part to test. E.g.[iCODE]return …

Member Avatar for nick.crane
0
868
Member Avatar for kalpa23

You might need to test the [I]CommandName[/I] property of the [I]DataGridCommandEventArgs [/I]to only execute your command code when needed. For an example see the ItemsGrid_Command function here [URL="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datagrid.itemcommand.aspx"]MSDN DataGrid.ItemCommand Event[/URL]

Member Avatar for nick.crane
0
193
Member Avatar for Duki

Add takes four parameters. Look here [URL="http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.sheets.add.aspx"]Sheets.Add[/URL]. The most important one is the last one that defines what you are adding.

Member Avatar for nick.crane
0
107
Member Avatar for Duki
Member Avatar for kalpa23

That is because you have delared it [I]static[/I]. Remove [I]static[/I] from the total delcaration and see what happens.

Member Avatar for nick.crane
0
244
Member Avatar for Pokenerd

I like your ship. There is a native matrix transform that you can use in the [I]System.Drawing.Drawing2D[/I] namespace. Below is an example of how I might do it using a GraphicsPath. The draw method could be adapted to plot any GraphicsPath with rotation and location parameters. [CODE] // GraphicPath to …

Member Avatar for nick.crane
0
906
Member Avatar for santoshj.1983

[QUOTE=Lusiphur] ((I was going to post this an hour ago but my phone company decided it would be a good time to perform a "DSL Conversion" for my entire area effectively killing my phone, internet and TV for an hour :@ ))[/QUOTE] @Lusiphur: Meanwhile the poor student was wondering how …

Member Avatar for Lusiphur
0
86
Member Avatar for Mikey12345

@Lusiphur: The [I]LinearGradientBrush[/I] is used to fill a shape using linear shading. It does not draw a curved line. This will not help. I don't think there is anything native to .Net that supports drawing bell curves. May be someone else can help.

Member Avatar for ddanbe
0
1K
Member Avatar for sandy542

The error is in this line. [CODE]SqlCommand cmd = new SqlCommand("insert into example values('"+txtfname.Text+"','"+txtlname.Text+"'),con");[/CODE] Check the position of your quote marks (").

Member Avatar for nick.crane
-4
86
Member Avatar for anerchy

I'm guessing that Error 1 is here [iCODE]textBox1.Text(a);[/iCODE] This should be [iCODE]textBox1.Text = a;[/iCODE] This will also clear the other error. However, you will also get a run-time error here [ICODE]deger2 = double.Parse(textBox1.Text); [/ICODE] because [I]double [/I]does not parse mathematical expressions. You will have to parse the sums yourself. However, …

Member Avatar for nick.crane
0
246
Member Avatar for azfarhus
Member Avatar for Scale

Classes do not run in threads, methods do. In case you have not solved this, here is my solution: [CODE]public void MySTAMethod() { Debug.WriteLine(string.Format("Thread ApartmentState = {0}", Thread.CurrentThread.GetApartmentState())); if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) { Thread t = new Thread(new ThreadStart(MySTAMethod)); t.SetApartmentState(ApartmentState.STA); t.Start(); } else { Debug.WriteLine(string.Format("Clipboard.ContainsText() = {0}", Clipboard.ContainsText())); } }[/CODE] …

Member Avatar for nick.crane
0
97
Member Avatar for zismad

The RadioButton screen has a [I]ButtonProperty [/I]property. The text there defines an installer variable name which is assigned either [I]Button1Value [/I]or [I]Button2Value[/I]. On your ProjectOutput for program A and B set the [I]Condition [/I]property to test the value of this installer variable. E.G. program A Condition : BUTTON2=1 program B …

Member Avatar for nick.crane
0
88
Member Avatar for virusisfound

Yes, I am sure there are lots of people who know how to do that. However, generelly, vague request like yours do not get many replies. If you have any specific questions please ask and someone is sure to help.

Member Avatar for virusisfound
0
120
Member Avatar for angel_eyez

If you made changes that made it go wrong then undo those changes and try again. Otherwise, [B]post some code [/B]so that we can see what you are doing!

Member Avatar for nick.crane
0
101
Member Avatar for alex9292

[CODE]throw new ApplicationException("This book is too expensive.");[/CODE] See also MSDN Help for [URL="http://msdn.microsoft.com/en-us/library/ms173163.aspx"]Creating and Throwing Exceptions (C# Programming Guide)[/URL]

Member Avatar for nick.crane
-2
93
Member Avatar for bbman

[QUOTE=vdeych] To avoid this, use the "ref" keyword when passing your list to a function, for example: [CODE]private void SetList(ref List<string> list) { ...some code here... }[/CODE] This way, your itemsetcurrent will always point to the same data as itemset1 [/QUOTE] Lists are reference types and are passed by reference …

Member Avatar for vdeych
0
181
Member Avatar for Member 784588

I have no experience with MODI but it looks like you still have references to the [I]image [/I]and [I]layout [/I] at the point where you try to delete the image from disk. This might be what is preventing the delete working. (It might also be related to the other error, …

Member Avatar for nick.crane
0
228
Member Avatar for dreamy_ananya

You could add a static auto creating property (or method) in each of the TaskLayer classes. I use this strategy quit a lot when I want a common shared instance of a class. [CODE]namespace TaskLayer { public class A { private static A _default; public static A Default { get …

Member Avatar for vdeych
0
353
Member Avatar for MarkBrend

You said that [iCODE]public string oSQL2XStreamBridge( string Name) [/iCODE] does not work. What (and where) is the calling code? If it is remote, then a string might not be returned as you expect. Try with an [iCODE]Int[/iCODE] type first to see if that works.

Member Avatar for nick.crane
0
121
Member Avatar for CanYouHandstand

I think that what you realy need to do is set the [I]TabStop[/I] property to false. This is used by forms to determine what items can have focus. The first object in the Tab Order (i.e. [I]TabIndex[/I] = 0) with TabStop true is the object that gets focus when the …

Member Avatar for Amit.Tank001
0
3K
Member Avatar for shankbond

I have this so far [iCODE]string regexstring = @"\bhtml(\d+(\.(\d*))?)?\b|[.]net\b";[/iCODE] It returns 6 matches: ".net", ".net", ".net", ".net", "html4.0", "html" But I think you want the "htlm4.0" to match as "html" only. Is that right?

Member Avatar for shankbond
0
167
Member Avatar for Duki
Re: If()

Try keeping a converted value for arithmetic tests and use TryParse when doing convertions. [CODE] int Start_Miles1_Value = 0; int End_Miles_Value = 0; private void textBox1_TextChanged(object sender, EventArgs e) { int retVal = 0; if (Int32.TryParse(label_End_Miles.Text, out End_Miles_Value) && (End_Miles_Value > Start_Miles1_Value)) { retVal = End_Miles_Value - Start_Miles1_Value; } label_Miles_Drove1.Text …

Member Avatar for nick.crane
0
159

The End.