Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. prrm333

    print/printpreview a form

    I'm trying to print a form that is displaying a calendar with appointments with a series of textboxes for each day. I also have another textbox for the individual date numbers. This is all working fine except for showing the date numbers on the form when printing. It displays the textboxes with...
  2. prrm333

    Refresh an array of buttons

    I'm not sure about changing the code yet as I spent a little time with your suggestions but didn't get too far. However to the best of my testing I think the problem with my code and updating is in the following section of my code: if (m_dtContacts.Rows.Count == 0) {button.Enabled = false;}...
  3. prrm333

    Refresh an array of buttons

    I have the following code on form load that works correctly to create an array of buttons to filter a database by last name for A-Z and #'s and disable any buttons that have no results return for that letter: private void getAlpha() { int locX = 12, locY = 76, i = 0; string sqlText = ""; char[]...
  4. prrm333

    XML to store multiple SQL Queries

    The reason for saving queries to an xml file is to allow the user to also save queries to other tables within the database that are not hardcoded into the program. At this point there are 3 grids I created that go to 3 different tables with queries built based on selections from available...
  5. prrm333

    XML to store multiple SQL Queries

    I thought it had to do with special characters, I'll look into it. The program allows the user to look at specific SQL tables. But in this case the user can type in there own queries and save them to a file if they use them consistenly. I was only using that query as an example as it contains...
  6. prrm333

    XML to store multiple SQL Queries

    I have a function that works to save in an xml file a query, userID and userPassword that is working correctly. I also have the ability on the form for the user to type in a query to use or save. This also includes the ability with a checkbox to add text for a date range. When I check this...
  7. prrm333

    Datagridview non printable characters

    I'm not sure what the concern is about my posting. The only thing not there is the full query as it's too long but it is basically as I posted a select * from the table. Everything else is exactly the code I am using.
  8. prrm333

    Datagridview non printable characters

    I use the following to load a datagridview from a SQl database: SqlConnection cn = new SqlConnection(sConn1); SqlDataAdapter da = new SqlDataAdapter("Select * from table", cn); DataSet ds = new DataSet(); da.Fill(ds, "web_trans"); dataGridView1.DataSource = ds.Tables["web_trans"]; cn.Close()...
  9. prrm333

    ReportViewer controlling nulls

    Thanks for the info, I modified it to the following: =IIf(Fields!HPhone.Value = "", "", ("(" & Left(Fields!HPhone.Value,3) & ")" & " " & Mid(Fields!HPhone.Value,4,3) & "-" & Right(Fields!HPhone.Value,4))) But using your code I got the start I needed. I also found the Reporting Service Forum...
  10. prrm333

    ReportViewer controlling nulls

    I am able using an expression to output a phone number in the (###) ### - #### format and if the field is blank I end up with () -. I would like to using an expression like Crystal Report show nothing if the field is blank. How do I do this? Also does anyone have a good tutorial on using...
  11. prrm333

    Create new xml file

    I am using the following code to create an xml file to run on form load if the file is not found: XElement xml = new XElement("Config", new XElement("wStatus", ""), new XElement("wStatus", "1"), new XElement("wStatus", "2"), new XElement("wStatus", "3"), new XElement("wCode", ""), new...
  12. prrm333

    tabcontrol1 event

    I figured out what the problem was. In the .designer.cs tab the following was missing from the tabControl1 properties: this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); Thanks.
  13. prrm333

    tabcontrol1 event

    I don't know if this changes anything but the textbox I am trying to hide is on the main form and not on any of the pages of the tabControl. In my naming convention I hadn't gotten around to changing the name yet. Anyway it still doesn't work, any ideas? Thanks.
  14. prrm333

    tabcontrol1 event

    I'm trying to get something similar to below to work to hide or disable a textbox when a particular tab is active or selected. The following code doesn't seem to do anything: private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { if...
  15. prrm333

    Code Not Working

    As far as I can tell the following is the corrected code that prints correctly: private void printDoc_PrintPage(Object sender, PrintPageEventArgs e) { Font _normalFont; _normalFont = new System.Drawing.Font("Arial", 12, FontStyle.Regular); int a = 20; int b = 20; y = 80...
  16. prrm333

    Code Not Working

    The corrected code above that I posted works correctly except for one flaw that I haven't fixed yet. The print preview I have it open up in works fine but when I then select to print the document only the last page actually prints. I get the same results when I send it to the printer or if I...
  17. prrm333

    Substring problem

    Thanks for the help as I solved the problem. I was using the following part incorrect: string hPhone1 = hPhone1.Substring(0, 3); I had started out with: string hPhone1 = hPhone1.Substring(1, 3); So the index was incorrect so I changed it to reflect the correct location within the string and...
  18. prrm333

    Substring problem

    The code I used should be as follows: var number = dt["HPhone"].ToString(); var as_string = string.Format("{0}-{1}-{2}", number.SubString(0, 3), number.SubString(4, 3), number.SubString(7));
  19. prrm333

    Substring problem

    Using the following: var number = dt["LastName"].ToString(); var as_string = string.Format("{0}-{1}-{2}", number.SubString(0, 3), number.SubString(4, 3), number.SubString(7)); I am getting the following error: Error 1 'string' does not contain a definition for 'SubString' and no extension...
  20. prrm333

    Code Not Working

    My solution minus the page header information is the following: private int countLine = 0; private int horizontalPosition = 60; private void printDoc_PrintPage(Object sender, PrintPageEventArgs e) e.HasMorePages = false; string sqlText = "Select * From Contacts order by...

Part and Inventory Search

Back
Top