Search results for query: *

  1. PDS8475

    Count datagridview rows where value not equal to zero

    Hi I have a datagridview which shows the results of searches. One of the datagridview columns is called price. I have a textbox showing the total of this column. But to do this I had to tell the program to put 0 in records where this field is empty. Now I want to count the records where this...
  2. PDS8475

    Resolved How to check multiple values in one record

    ...trying to check if a specific record exists in the database. I am Using the following code OleDbCommand check_All = new OleDbCommand("SELECT COUNT(*) FROM Donations WHERE EquipmentType = @TestType AND EquipmentMake = @TestMake AND EquipmentModel = @TestModel AND EquipmentSerial =...
  3. PDS8475

    Resolved Select where

    I used the line string n = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Detail_textBox.Text); and passed n as the parameter. That works but I will have to do it on all the forms. Thanks for the help.
  4. PDS8475

    Resolved Select where

    Hi there are no wildcards in the parameter and I am using LIKE instead of = I'm using a Microsoft access database. Like you said I wasn't expecting it to be case sensitive and when I found it was case sensitive using =, I switched to LIKE thinking that would cure it. Maybe it is because the...
  5. PDS8475

    Resolved Select where

    Hi I have the following select statement Cmd.CommandText = "Select EquipmentMake, EquipmentModel, EquipmentSerial FROM Repairs WHERE CustomerName like @Name"; but this only finds results if the Value @Name is entered exactly like it is in the database. How can I change it so the user could...
  6. PDS8475

    Help needed with tutorial

    The only data source that I can see is on Form1 and is called receiptBindingSource and has the binding source property set as PrintReceiptDemo.Receipt. The project data source is set to Receipt. frmPrint other than me adding the line "BindingSource ReceiptBindingSource = new BindingSource();"...
  7. PDS8475

    Help needed with tutorial

    The tutorial I have been trying to do is There isn't an exception error. So debugging doesn't show any error. But when frmPrint opens that message is across the report viewer. To me it is as if the parameters are never making it to the report. But I don't know why.
  8. PDS8475

    Help needed with tutorial

    ...public double Price { get; set; } public int Quantity { get; set; } public string Total { get { return string.Format("£{0}", Price * Quantity); } } } } The winform Form1 is coded using System; using System.Collections.Generic; using System.Windows.Forms; namespace...
  9. PDS8475

    Answered Carriage return in drawstring?

    It worked this time. I think I was putting / rather than \ and it was just printing */r/n
  10. PDS8475

    Answered Carriage return in drawstring?

    Hi I have this line that draws the string. graphics.DrawString("*" + barcodeMake + "*" + " " + "*" + barcodeModel + "*" + "*" + barcode + "*", ofont, black, point); this works and I use it to print barcodes. But the barcodes are printed one after the other. Is there a way to put a carriage...
  11. PDS8475

    Resolved Textbox to display date one year from today

    I have a form that on load displays the date now in a text box. I also want it to display the date one year from now in another textbox but I do not know how to achieve this. Looking online I can only find examples of date now as text.
  12. PDS8475

    Answered ExecuteReader not working

    Thank you to both of you. I didn't realise the order of the parameters mattered.
  13. PDS8475

    Answered ExecuteReader not working

    If I have string sn = SiteName_textBox.Text; string sa = SiteAddress_textBox.Text; try { OleDbConnection connection = new OleDbConnection(@"Provider = Microsoft.Jet.OLEDB.4.0; Data Source = |DataDirectory|\Admins.mdb; Jet...
  14. PDS8475

    Answered ExecuteReader not working

    I have a database table called Sites with to columns SiteName and SiteAddress The following code is on a button click event. I have removed the database password from the connection string intentionally before posting. When I step through the code, I can see the connection state opens. However...
  15. PDS8475

    Answered Problem with output of query which is shown in a DataGridView

    Thank you That works perfectly
  16. PDS8475

    Answered Problem with output of query which is shown in a DataGridView

    ...that but I must be doing something wrong. { using (OleDbCommand icommand = new OleDbCommand("Select * FROM ItemsForSale INNER JOIN Engineering ON Engineering.Serial = ItemsForSale.Serial WHERE Engineering.Name = @s", iconnection))...
  17. PDS8475

    Answered Problem with output of query which is shown in a DataGridView

    Just incase my problem isn't clear, here are two screenshots, The first being unfiltered and the second filtering by Name.
  18. PDS8475

    Answered Problem with output of query which is shown in a DataGridView

    Hi I have a problem with the following query "Select * FROM ItemsForSale INNER JOIN Engineering ON Engineering.Serial = ItemsForSale.Serial WHERE Engineering.Name = @s" I am using this to filter the results and it fetches the right results in the DataGridView, However the first 4 columns are...
  19. PDS8475

    Resolved Problem with query "Maximum of one result"

    Thanks for the help guys. I have now done it with the Query below. "Select * FROM ItemsForSale INNER JOIN Engineering ON Engineering.Serial = ItemsForSale.Serial WHERE Engineering.Name = @s"
  20. PDS8475

    Resolved Problem with query "Maximum of one result"

    The "I" just donates the table that is being used in this case ItemsForSale , the prefix is "e" for the engineering table and so on
Back
Top Bottom