Not sure of all the types of the fields but try this string query2 = "select sum(amount) AS Total from pur_inv_dtl where inv_id = '" + IdTxt.Text + "'";
OkkiePepernoot
Posts
-
Need Help -
Collection of unique idsSystem.Collections.Generic.HashSet
-
Com Exception - excelI did but still can't reproduce. Using Excel 2010.
-
Com Exception - excelMade some changes in the Button_Click event and could not reproduce the issue. //Range objRange = null; string cell1 = string.Empty, cell2 = string.Empty; string[] chars = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T" }; for (int row = 1; row < 1000; row++) { for (int column = 0; column < 20; column++) { cell1 = chars[column] + row.ToString(); //objRange = _objWorkSheet.get_Range(cell1, cell1); _objWorkSheet.get_Range(cell1, cell1).Value2 = cell1; } } //System.Runtime.InteropServices.Marshal.ReleaseComObject(objRange); //objRange = null; SaveExcel();
-
How to write this regex?Perhaps something like this: string inputText = "+{}^%"; // This is the search string Regex regex = new Regex("[\\%\\{\\}\\^\\+]",RegexOptions.Compiled); // This is the replacement string string regexReplace = "{$&}"; // Replace the matched text in the InputText using the replacement pattern string result = regex.Replace(inputText,regexReplace);
-
how to partially change the font color of the words in a excel cell//Assuming you did not select the cell yourself rng2.get_characters(1,1).Font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red);
-
How to pad a string with zeroesNot sure if this is what you mean but try this: string strLong = String.Format(CultureInfo.InvariantCulture, "{0:00000.0000}", Double.Parse("455.66", CultureInfo.InvariantCulture));
-
Remove all characters in a string up to and including a specified patternstring initialText = "this_is_a test|XXmoretexthere";
string searchString = "|XX";
int lastIndexFound = initialText.LastIndexOf(searchString);
if (lastIndexFound > 0)
{
MessageBox.Show(initialText.Substring(lastIndexFound + searchString.Length));
}
else
{
MessageBox.Show("Patternt not found");
}- Not sure if this is fast enough...
- Not sure if the search is case sensitive otherwise....
-
Only allow for a double in textboxWhy not using a ConvertEventHandler delegate ?
-
Adding items at bottom in List ViewSomething like this: this.listView1.Clear(); this.listView1.Items.Add("Item 2"); this.listView1.Items.Add("Item 1"); this.listView1.Sorting = SortOrder.Ascending; this.listView1.Sort(); this.listView1.Sorting = SortOrder.None; this.listView1.Items.Add("Temp1"); this.listView1.Items.Add("Temp2");
-
tab key in a textboxWhy not use the Leave or Validated event for this ?