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...
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;}...
...locY += 30;
if (i == 14)
{
locY = 76;
locX = 42;
}
m_dtContacts.Clear();
if (s == "#")
{
sqlText = "SELECT * FROM Contacts WHERE [LastName] LIKE '[0-9]%'";
}
else if (s == "All")
{
sqlText = "Select * From Contacts order by...
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...
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...
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...
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.
...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();
I then...
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...
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...
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...
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.
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.
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...
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...
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...
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));
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.