|
Hi,
Is there any FREE webserive or Database to populate Country, Metros, State, City, Zip.
a) all Country list
b) Metros in a Country
c) States in a Country
d) Cities in a State
Thanks in advance
|
|
|
|
|
I couldn't find anything when I looked for this last month, but maybe you will have better luck! (I did find some limited resources that tell you the states that match zip codes for the US, Germany, and Canada (Provinces in Canada))
|
|
|
|
|
i want to show the percentage of the records in pie charts and bar charts using the crystal reports.Can somebody please provide any useful link.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Any idea how to add anything to a full screen video implemented using DirectX SDK??
Say subtitle, slider, a button, any control..
Thanks
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello friends,
How can i check that a value entered in the TextBox is a numeric value i.e integer or double value?
Thanks,
Nagendra.
|
|
|
|
|
Decimal.TryParse
Int.TryParse
|
|
|
|
|
System.VisualBasic.IsNumaric(string str) which will returns boolean value
Ramana
|
|
|
|
|
But that means adding the VisualBasic assembly to your projects and makes you feel dirty
*shudders and scrubs to get clean again*
hehe, but seriously thats a good answer
|
|
|
|
|
Hi,
In C# "IsNumeric" method is not available. You can do its manually using "char.IsNumber() or char.IsDigit()" in KeyPress events.
Here is the code snippet:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (!char.IsNumber(e.KeyChar))
e.Handled = true;
}
Thanks,
Gopal.S
|
|
|
|
|
OK - so you assume here that 42.03 is not a number.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
Thanks for your reply.
I was checked only integer value. You can check "." and other special characters seperatly for double value.
Here is code snippet for double value:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
TextBox txtBox = sender as TextBox;
if (e.KeyChar == '\b') { return; }
if (Char.IsDigit(e.KeyChar))
{
string amount = txtBox.Text;
int pos = txtBox.Text.IndexOf('.');
if ((pos > 0) & (amount.Length > 10))
{
e.Handled = true;
return;
}
if ((pos == -1) & (amount.Length > 7))
{
e.Handled = true;
return;
}
if ((pos > 0) & (txtBox.SelectionStart > pos))
{
amount = amount.Substring(pos, amount.Length - pos);
if (amount.Length > 2)
e.Handled = true;
}
else
e.Handled = false;
}
else if (e.KeyChar == '.')
{
if (txtBox.Text.IndexOf('.') > 0)
e.Handled = true;
}
else
e.Handled = true;
}
This code support eight integer value and two decimal digits.
Please let me know this will help for you.
Thanks,
S.Gopal.
Gopal.S
|
|
|
|
|
You know you can add a reference to Microsoft.VisualBasic and do the equivilent call (Microsoft.VisualBasic.Information.IsNumeric) right?
|
|
|
|
|
Hi originSH,
I told only this feature not available in C#. Also I don't know VisualBasic. However I have tested your solution, this is very help to solve this problem simply.
Thanks for your suggestion.
Regards,
Gopal.S
|
|
|
|
|
Try to define new string that contain \n in fine Resources.resx but when look ion the debug i see its like \\n -
What to do ?
Thanks.
|
|
|
|
|
Hi all,
I would like to have a dropdown control column in my windows form datagrid,
can anyone please help me with this??
I am using .NET 1.1
Thanx in advance!
|
|
|
|
|
never mind i found something
|
|
|
|
|
Hi!
Does anyone knows how to cancel an Installation from a Custom Installer class?
Thanks,
vSoares
|
|
|
|
|
Hello everybody,
I'm new here and beginner in C#. I have a question for you,please.
I have a listbox,and I want to copy all items to clipboard.
private void btnCopy_Click(object sender, EventArgs e)
{
for (int i = 0; i < lstAll.Items.Count; i++)
{
lstAll.SetSelected(i, true);
}
Clipboard.SetDataObject(lstAll.SelectedItems.ToString(), true);
}
this is the output: System.Windows.Forms.ListBox+SelectedObjectCollection
What I am doing wrong here?
Please help!!!
|
|
|
|
|
Abelinda81 wrote: What I am doing wrong here?
For a start, do you really want to select everything in the list box also? (You're thinking about how a user might do this, not how to do it programmatically)
Also, what do you actually want to appear in the clipboard? The list box has no idea about the clipboard so you have to format the data for it.
What you might want to do is create a StringBuilder and build up a list of the items with an Environment.NewLine at the end of each item, rather than selecting all the items in the list box.
|
|
|
|
|
Yes, I want to select everything in the listbox as I gathered all the info I need from other listboxes in this final one(lstAll). and now I want to select all items in listbox and copy to clipboard:
private void btnCopy_Click(object sender, EventArgs e)<br />
{<br />
StringBuilder strAll = new StringBuilder();<br />
<br />
for (int j = 0; j < lstAll.Items.Count; j++)<br />
{ <br />
lstAll.SetSelected(j, true);
But I don't now what should I put here before:
Clipboard.SetDataObject(strAll.ToString(), true);
Thank you in advance for your answer(s)!
|
|
|
|
|
You haven't answered the question: Do you really want to select everything in the list box. You are selecting the contents of the list box with apparently no purpose.
foreach(object item in lstAll)
{
strAll.Append(item.ToString());
strAll.Append(Environment.NewLine);
}
|
|
|
|
|
Hi people...
I'd like to do this:
myButton.Click = null;
But with events I can only use += and -= ... The problem is that I don't know which handlers are associated with this button...
Any Idea?
|
|
|
|
|
Which ever classes do the += should also being doing the -=.
All you need to do is use the exact same line as the += but with -=
|
|
|
|
|
hello,
I wrote the following program. it should be able to make changes in active directory. but it doesn't do it.
can you look at my code and say to me what does not go with?
THANK YOU
using System;
using System.Drawing;
using System.Collections;
using System.Collections.Generic;
using System.DirectoryServices;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Text;
namespace fichier
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dataGrid1;
private Button btnWriteToLDAP;
private DataTable m_dt;
//private System.Windows.Forms.TextBox textBox1;
//
// required designer variable.
private System.ComponentModel.Container components = null;
public Form1()
{
// required for windows Form Designer support
InitializeComponent();
// TODO Add any constructor code after InitializeComponent call
}
// clean up any resources being used
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
// required method for designer support - do not modify
// the contents of this method with the code editor.
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.btnWriteToLDAP = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(8, 40);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(400, 400);
this.dataGrid1.TabIndex = 0;
//
// btnWriteToLDAP
//
this.btnWriteToLDAP.Location = new System.Drawing.Point(415, 40);
this.btnWriteToLDAP.Name = "btnWriteToLDAP";
this.btnWriteToLDAP.Size = new System.Drawing.Size(75, 23);
this.btnWriteToLDAP.TabIndex = 1;
this.btnWriteToLDAP.Text = "WriteToLDAP";
this.btnWriteToLDAP.UseVisualStyleBackColor = true;
this.btnWriteToLDAP.Click += new System.EventHandler(this.btnWriteToLDAP_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(680, 425);
this.Controls.Add(this.btnWriteToLDAP);
this.Controls.Add(this.dataGrid1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false);
}
#endregion
// the main entry point for the application
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
// on crée une table
m_dt = new DataTable("test");
// on crée des colonnes
m_dt.Columns.Add("TelephoneNumber", System.Type.GetType("System.Int32"));
m_dt.Columns.Add("User", System.Type.GetType("System.String"));
StreamReader fichier = File.OpenText(@"h:\\export.txt");
while (fichier.Peek() >= 0)
{
// on lit une ligne et on ajoute
string ligne = fichier.ReadLine();
string[] vals = ligne.Split(';');
DataRow dr = m_dt.NewRow();
try
{
dr["TelephoneNumber"] = int.Parse(vals[0]);
dr["User"] = vals[1];
m_dt.Rows.Add(dr);
}
catch (Exception ex)
{
Console.WriteLine(ex.GetType().ToString());
Console.ReadLine();
}
}
// on genere le tableau
dataGrid1.DataSource = m_dt;
}
private void btnWriteToLDAP_Click(object sender, EventArgs e)
{
{
DirectoryEntry deUser = new DirectoryEntry("LDAP://ou=User, ou=User Office, ou=User, DC=hte,DC=intra", "don", "mamanetpapa");
DirectorySearcher searchEmploye = new DirectorySearcher(deUser);
searchEmploye.Filter = "(objectClass=user)";
// Display all Employe
foreach (SearchResult unResultat in searchEmploye.FindAll())
{
DirectoryEntry unEmploye = unResultat.GetDirectoryEntry();
}
// Modification of the telephoneNumber
foreach (SearchResult unResultat in searchEmploye.FindAll())
{
DirectoryEntry unEmploye = unResultat.GetDirectoryEntry();
foreach (DataRow row in m_dt.Rows)
{
/*if (row[0].ToString().Contains(" "))
{
string[] str = row[0].ToString().Split(" ");
}*/
MessageBox.Show(unEmploye.Properties["SAMAccountName"].Value.ToString());
if (unEmploye.Properties["SAMAccountName"].Value == row[1])
{
string temp = string.Format("{0} {1}", row[1], row[0]);
MessageBox.Show(temp);
unEmploye.Properties["telephoneNumber"].Value = row[0].ToString();
unEmploye.CommitChanges();
}
}
}
}
}
}
}
Dorine
|
|
|
|
|
dorine82 wrote: it should be able to make changes in active directory. but it doesn't do it.
Boy, that's specific. Handing someone your code and saying "My program doesn't work!" isn't going to get you any useful responses.
Care to explain what you expect this code to do and what it's doing/not doing? Any error messages??
|
|
|
|