458 Posted Topics
Re: 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 … | |
Re: This post may help you: [Click Here](http://www.daniweb.com/software-development/vbnet/code/445801/use-parameterized-queries-to-avoid-sql-injection-attacks) | |
![]() | Re: 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 … ![]() |
Re: 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 … | |
Re: 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 … | |
Re: 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/) | |
Re: 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 … | |
Re: 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? | |
Re: [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. | |
Re: 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) … | |
Re: * 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 … | |
Re: Change line 28 to `Console.WriteLine(a);` or `Console.WriteLine(this.a);` | |
Re: 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 … | |
Re: 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 '$')." ); … | |
Re: 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: … | |
Re: 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(); … | |
Re: 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. | |
Re: 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 … | |
Re: 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) * … | |
| |
Re: 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. | |
Re: Have you checked the "Power Options"? | |
Re: 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 … | |
Re: 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;` | |
Re: 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 … | |
Re: This would be better in a class. Then use an array of your class type. | |
Re: 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 = … | |
Re: 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. … | |
Re: 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. | |
Re: 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 … | |
Re: `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)` | |
Re: 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 … | |
Re: Where is the output? Were you required to make all of those items menu items? It doesn't seem very user-friendly. | |
Re: 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, … | |
Re: 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 … | |
Re: 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/) | |
Re: 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) | |
Re: TestAccount class with main method. public class TestAccount { public static void main(String[] args) { // add your code here }//main }//TestAccount | |
Re: 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 … | |
Re: 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) | |
Re: 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. | |
Re: 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 | |
Re: Because it's not a TimeSpan. Use `DateTime.Now.TimeOfDay`. That is if ts1 is of type TimeSpan. | |
Re: 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) | |
Re: 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 … | |
Re: Clear the CMOS. Remove the CMOS battery for 30 - 60 seconds and replace. Reboot the computer. | |
Re: What do you mean by "calling C++ from C#"? Are you wanting to use a dll? | |
Re: 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 … |
The End.