458 Posted Topics

Member Avatar for anisha.silva

I'm not an expert with regex, but have used it. I think that many of the regex engines use similar syntax although there are some small differences. What worked for me was to start with a small regex expression, test it and then keep adding to it until it did …

Member Avatar for anisha.silva
0
221
Member Avatar for NhlanhlaNH
Member Avatar for cgeier
0
61
Member Avatar for mavtcr

This post may help you: [Click Here](http://www.daniweb.com/software-development/vbnet/code/445801/use-parameterized-queries-to-avoid-sql-injection-attacks)

Member Avatar for mavtcr
0
4K
Member Avatar for aabbccbryanmark_1

You probably need to add this after line 23: cmd = New SqlCommand() so your code will be: conn = New OleDbConnection(Get_Constring) conn.Open() cmd = New SqlCommand() cmd.Connection = conn but it is hard to know for sure because you didn't post the rest or your variable declarations. Also, add …

Member Avatar for aabbccbryanmark_1
0
198
Member Avatar for GagaCode

If you have the ability to modify the database, you could change "Required" to "false" for the column, or assign a default value. Alternatively, you could programmatically assign a default value. See below for an example: *Note: Need `using System.Data.OleDb;` statement. private static OleDbConnection dbConn = null; static string connectStr …

Member Avatar for GagaCode
0
214
Member Avatar for ZER09

Did you check out [DataGridView.IsCurrentRowDirty](http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.iscurrentrowdirty(v=vs.110).aspx) *"This property returns true when the pencil glyph is displayed in the row. By default, the IsCurrentRowDirty property will always equal the value of the IsCurrentCellDirty property, unless the DataGridView is bound to a data source that supports editing, or virtual mode has been implemented …

Member Avatar for ZER09
0
183
Member Avatar for overwraith

This looks like it would be best in a database. There are free ones like [SQLExpress](http://www.microsoft.com/en-us/download/details.aspx?id=27597) and [mySql](http://dev.mysql.com/downloads/)

Member Avatar for cgeier
0
206
Member Avatar for Gen_2

You're still passing "string" data. Private Sub insertMyTable(ByRef conn As SqlConnection, ByVal myVal1 As Decimal, ByVal myVal2 As String) Dim sqlCmd As SqlCommand Dim sqlText As String sqlCmd = New SqlCommand() sqlText = @"INSERT INTO myTable(col1, col2) VALUES(@myVal1, @myVal2)" Dim paramName0 As SqlParameter paramName0 = New SqlParameter() paramName0.SqlDbType = SqlDbType.Decimal …

Member Avatar for Gen_2
0
437
Member Avatar for Subhashini.V

What tables? Join your tables in your select statement. Need more information about the table structures. You haven't shown that you've made any attempt. Where's your code?

Member Avatar for Begginnerdev
0
313
Member Avatar for LyingInAHammock

[Click Here](http://www.gavaghan.org/blog/free-source-code/geodesy-library-vincentys-formula-java/) for a resource. Also [Here](http://stackoverflow.com/questions/569980/how-to-calculate-distance-from-a-gpx-file/570048#570048) is another resource. [Here](http://stackoverflow.com/questions/574691/mysql-great-circle-distance-haversine-formula) is another.

Member Avatar for jwenting
0
564
Member Avatar for Ezekiel_1

As far as formatting goes, create a function call "space" string space(int numSpaces) { string mySpace; for (int i=0; i < numSpaces; i++) { mySpace += " "; }//for return mySpace; }// To use it: cout << space(9) Change line 20 (and some of the other ones) to: cout<< space(9) …

Member Avatar for David W
0
527
Member Avatar for Radio2006

* Click "Start" * Select "Control Panel" If "View by" is "Category": * Click "Network and Internet" * Click "Network and Sharing Center" * Click on "Set up a new connection or network" If "View by" is "Large icons" or "Small icons": * Click "Network and Sharing Center" * Click …

Member Avatar for Radio2006
0
252
Member Avatar for masterinex
Member Avatar for KushMishra
0
173
Member Avatar for custurd122000

Your code doesn't compile. In class "Computer": In (line 52), "compareTo", you state that your return type is "int". However, the return type for "getMmax" is "int []" (an int array). You attempt to subtract two int[] (and return the result). In class "Prog4": * You attempt to create a …

Member Avatar for cgeier
0
512
Member Avatar for pekemp23

Delete line 7 which is your package statement. Try something like the following for your exception (line 133-137): catch (NumberFormatException ex) { System.out.println("There was an error in the donation box."); if (charityDon.contains("$")) { javax.swing.JOptionPane.showMessageDialog(null, "'Charity amount' contains non-numeric characters. Please enter a valid monetary value (do not use '$')." ); …

Member Avatar for cgeier
0
331
Member Avatar for GagaCode

On your combobox, use either event "SelectedValueChanged" or "SelectedIndexChanged". **SelectedValueChanged** private void EMP_CB_SelectedValueChanged(object sender, EventArgs e) { Console.WriteLine("ValueMember A: " + EMP_CB.ValueMember.ToString() + " DisplayMember A: " + EMP_CB.DisplayMember.ToString()); //--------------------------- //Get data for selected item //--------------------------- DataRow selectedDataRow = ((DataRowView)EMP_CB.SelectedItem).Row; int empId = Convert.ToInt32(selectedDataRow["EMPCODE"]); string empName = selectedDataRow["EMPNAME"].ToString(); Console.WriteLine("empId A: …

Member Avatar for GagaCode
0
417
Member Avatar for Typhooncoder

You need to create an instance of it with the "new" keyword. `SqlDataAdapter da = new SqlDataAdapter();` which should get rid of your error. Try the following: String connection = "Data Source=(LocalDB)\\v11.0;AttachDbFilename=C:\\Users...."; SqlConnection conn = new SqlConnection(connection); SqlDataAdapter da = new SqlDataAdapter("select * from Tbl", conn); ds = new DataSet(); …

Member Avatar for cgeier
0
219
Member Avatar for Typhooncoder

In line 22 you stated that if any of the 4 checkboxes are checked then ....(line 30): correct = true. In line 36, if correct is true, it is a match.

Member Avatar for cgeier
0
210
Member Avatar for lilrhace07

Use a panel. Put a Panel (or GroupBox) on your form. Put the radio buttons on the panel (or GroupBox). Then use the "CheckChanged" (radio button) event: **AndRadioButton_CheckedChanged** private void AndRadioButton_CheckedChanged(object sender, EventArgs e) { if (AndRadioButton.Checked) { Console.WriteLine("AndRadioButton selected."); }//if else { Console.WriteLine("AndRadioButton NOT selected."); }//else } **OrRadioButtion_CheckedChanged** private …

Member Avatar for cgeier
0
239
Member Avatar for Gabriel_4

In line #2 try changing the space between "OLEDB" and "12.0" to a "." (dot or period). So the line reads: `Provider = Microsoft.ACE.OLEDB.12.0; ` instead of `Provider = Microsoft.ACE.OLEB 12.0;` If you still have problems, ensure you can make a connection in VS. * Select "View" (from menu) * …

Member Avatar for cgeier
0
124
Member Avatar for saher007
Member Avatar for havoc0921

Need to use exception handling. try { //run your code here... } catch (FileNotFoundException e) { System.err.println("FileNotFoundException: " + e.getMessage()); //do whatever you want to do when //this exception happens }// [Click Here](http://docs.oracle.com/javase/tutorial/essential/exceptions/catch.html) for documentation.

Member Avatar for JamesCherrill
0
224
Member Avatar for ryan.jay.ong
Member Avatar for fliponymous

Try something like the following: private static int Sum() { int subTotal = 0; string inputVal = string.Empty; //read value until an empty line is encountered while(!string.IsNullOrEmpty(inputVal=Console.ReadLine())) { int result = 0; //convert string to int //converted string will be in result Int32.TryParse(inputVal, out result); //add subTotal += result; }//while …

Member Avatar for cgeier
0
104
Member Avatar for Emma_3

Check your variable names. You declare `char star = '*'` and then you try to declare star as an int in your for loop. `int star = 0;`

Member Avatar for samson.dadson.3
0
254
Member Avatar for obspsalm22

Please search for "What is a graphical user interface" and read more about the purpose of a gui. Basically you are going to eliminate "TestClass" and replace it with your "GUI". [Click Here](http://www.daniweb.com/software-development/java/threads/472282/please-help-with-inventory-program-part-6#post2062447) to see an example of what someone else who had this assignment did. To enter data in …

Member Avatar for cgeier
0
357
Member Avatar for brandon66
Member Avatar for cgeier
0
317
Member Avatar for renagadejesus

I think that he would like you to place all of your variable declarations in one place rather than throughout your program. public static void main(String[] args) { //Declarations int first = 0; //first integer int second = 0; //second integer double result = 0; String option; Scanner in = …

Member Avatar for JamesCherrill
0
315
Member Avatar for Emma_3

Try writing the problem out in steps first. You can use pseudo-code (a combination of written language and computer language). Prompt for number of assignments - "numAssignments" for each assignment { Prompt for score - "enteredScore" totalScore = totalScore + enteredScore } averageScore = .... Now convert that into code. …

Member Avatar for cgeier
0
166
Member Avatar for spowel4

The value is stored in the registry under the following key: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page and additional "start" urls (tabs) are in: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Secondary Start Pages [Click Here](http://gallery.technet.microsoft.com/scriptcenter/e25bf8ea-e294-4680-af17-b984bed47e97) for a powershell script.

Member Avatar for cgeier
0
323
Member Avatar for CodeHaze

In line 14 change `int days;` to `int days = 0;` or whatever value you want to initialize it to. You really should do some input validation, then your switch statement becomes more predictable, and there won't be the possibility of invalid values. Right now I can enter values such …

Member Avatar for cgeier
0
576
Member Avatar for LeNenne

`app.path` shouldn't have quotes around it. Try `xlTmp.Workbooks.open (App.Path & "\kundreg\bokfaktura2.xls")`. If that doesn't work, then try putting `App.Path & "\kundreg\bokfaktura2.xls"` in a string variable first, and then passing the string variable to the open command `xlTmp.Workbooks.open (myStringVariable)`

Member Avatar for cgeier
0
223
Member Avatar for caltech

To auto-populate the BCC field in Outlook, we will create an e-mail template, and create a button that uses a macro to open the e-mail template. ## Enable Developer options ## 1. Open Outlook 2. Select "File" 3. Select "Options" 4. Click "Customize Ribbon" 5. In the right-pane, select the …

Member Avatar for cgeier
0
874
Member Avatar for pekemp23

Where is the output? Were you required to make all of those items menu items? It doesn't seem very user-friendly.

Member Avatar for stultuske
0
251
Member Avatar for murali2489

Read more about classpath. [classpath Documentation](http://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html) From the documentation: *...Multiple path entries are separated by semi-colons*.... *The default class path is the current directory. Setting the CLASSPATH variable or using the -classpath command-line option overrides that default, so if you want to include the current directory in the search path, …

Member Avatar for murali2489
0
299
Member Avatar for vibhu mishra

The following works for me: #include <cstdlib> //use 8.3 filename and directory name format //my file is in "c:\batch scripts\startmp3.bat" //To get the 8.3 directory name: //in cmd window run > dir "c:\" /x | find /i "batch scripts" system("c:\\batchs~1\\startmp3.bat"); //make sure to escape '' //should also be able to …

Member Avatar for cgeier
0
346
Member Avatar for matilda21
Member Avatar for mixelplik

Here are a couple of articles I found: [Null-terminated Character Arrays](http://classes.mst.edu/compsci53/ntca.htm) [Character sequences](http://www.cplusplus.com/doc/tutorial/ntcs/) [What is a null-terminated string?](http://programmers.stackexchange.com/questions/181505/what-is-a-null-terminated-string) [GetLine](http://www.cplusplus.com/reference/istream/istream/getline/)

Member Avatar for Ancient Dragon
0
123
Member Avatar for pavi.mythri.1

I don't really know anything about OpenCalais, but here's something I found doing a search: Security OpenCalais supports SSL security of traffic to and from OpenCalais. GoDaddy is the authority for SSL certification. Simply use https:// instead of http://. [OpenCalais Security Documentation](http://www.opencalais.com/documentation/calais-web-service-api/forming-api-calls/security)

Member Avatar for cgeier
0
345
Member Avatar for Royal_1

TestAccount class with main method. public class TestAccount { public static void main(String[] args) { // add your code here }//main }//TestAccount

Member Avatar for Slavi
0
742
Member Avatar for vishalbodhale

You might try the following to install the standard bluetooth COM port driver. 1. Control Panel 2. Devices and Printers (If "View by" is large icons or small icons). If "View By" is Category, then under Hardware and Sound, click "View devices and printers". 3. If you see your phone …

Member Avatar for cgeier
0
168
Member Avatar for godzab

Convert string to char array, then check each character to see if it is a digit using `Character.isDigit(char c)` See [isDigit Documentation](http://download.java.net/jdk7/archive/b123/docs/api/java/lang/Character.html#isDigit%28char%29) OR Use regex, with the split function. See [Java regex Documentation](http://docs.oracle.com/javase/tutorial/essential/regex/) See an [Example Here](http://www.tutorialspoint.com/java/lang/string_split.htm)

Member Avatar for Taywin
0
320
Member Avatar for chrisl007

1. Use a timer. For an example, [Click Here](http://stackoverflow.com/questions/3220477/how-to-use-clock-in-c) 2. Create 3 sorting functions. 3. Use a counter. 4. There is no substitution for practice.

Member Avatar for chrisl007
0
227
Member Avatar for Oremuss

I believe the number of permutations are as follows (for English alphabet): 4-letter permutations: 26*26*26*26 3-letter permutations: 26*26*26 2-letter permutations: 26*26 1-letter permutations: 26 Here is an article that explains it: http://www.mathsisfun.com/combinatorics/combinations-permutations.html

Member Avatar for Oremuss
0
209
Member Avatar for castajiz_2

Because it's not a TimeSpan. Use `DateTime.Now.TimeOfDay`. That is if ts1 is of type TimeSpan.

Member Avatar for ddanbe
0
175
Member Avatar for bobwahler

The following urls for powershell may be helpful: [Windows and Windows Server Automation with Windows PowerShell](http://technet.microsoft.com/en-us/library/dn249523.aspx) [Use PowerShell to Configure the NIC on Windows Server 2012](http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/21/use-powershell-to-configure-the-nic-on-windows-server-2012.aspx)

Member Avatar for cgeier
0
285
Member Avatar for kristina.densmore

For your program, pseudo-code might look like: Get diameter from user Get velocity from user radius = diameter / 2.0 PI = 3.14 area = PI * radius * radius volume = area * velocity Print volume of water flow In pseudo-code, you don't worry about how to properly write …

Member Avatar for cgeier
0
480
Member Avatar for twince.kumargarg

Clear the CMOS. Remove the CMOS battery for 30 - 60 seconds and replace. Reboot the computer.

Member Avatar for cgeier
0
224
Member Avatar for overwraith

What do you mean by "calling C++ from C#"? Are you wanting to use a dll?

Member Avatar for Fenrir()
0
79
Member Avatar for Robert_12

In **Inventory**, change **line 306**, // Change from: // unitPriceText.setText(DVD.getUnitPrice()); // To: unitPriceText.setText(Double.toString(DVD.getUnitPrice())); change **line 307**, from: // Change from: //invValueText.setText(DVDMovie.getInventoryValue());` // To: invValueText.setText(Double.toString(DVDMovie.getInventoryValue())); change **line 312**, // Change from: // restockingFeeText.setText(DVDMovie.getRestockingFee()); // To: restockingFeeText.setText(Double.toString(DVDMovie.getRestockingFee())); In **addItem** (line 217-218), you do the following: // number should be greater then previous …

Member Avatar for cgeier
0
990

The End.