|
Hi,
long time ago I started using this P/Invoke code:
[DllImport("user32.dll")]
public static extern bool MessageBeep(int type);
Not sure I still have to do it this way though.
BTW: Make sure through Control Panel Sounds the right sounds are installed.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks for the help, I found out that the PC Speaker is not supported anymore by Vista 64bit Systems!
|
|
|
|
|
Hi.
this is my coding
string MyString;
MyString = "Select * from timemgmt";
if (radioin.Checked == true)
{
cn = new OdbcConnection("Driver={Microsoft ODBC for Oracle};Server=orcl;UID=it;PWD=cr;");
cmd = new OdbcCommand(MyString, cn);
cn.Open();
cmd.CommandText = "insert into timemgmt values('" + textBox1.Text + "','" + label19.Text + "','" + label18.Text + "','" + label18.Text + "')";
cmd.ExecuteNonQuery();
cn.Close();
textbox1.text = employe ID
label19.text = System Date
label18.text = System Time
i want to do Accept employee ID in one time in a day 2nd time user give same Id in a same date not accepted
plzz give me some hints
thanks in Advance
Jawad Khatri
|
|
|
|
|
This is SQL query
if(select id from timemgmt where id=@id)=0
begin
insert values
end
but be aware from SQL Injections
mjawadkhatri wrote: "insert into timemgmt values('" + textBox1.Text + "','" + label19.Text + "','" + label18.Text + "','" + label18.Text + "')";
and rename controls by giving more meaningfull names.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
modified on Wednesday, July 15, 2009 4:40 AM
|
|
|
|
|
Where i Put This Query???
|
|
|
|
|
How can I load datagridview data to a database table
Thanks
|
|
|
|
|
Good Morning onyang2
You have to be carefull with the names.
There is a GridView and a Datagrid.
is this a Windows App or a Web App ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
|
that is a gridview, you must asp such questions in the ASP.NET Forum next time.
here is a solution
http://www.dotnetfunda.com/articles/article131.aspx[^]
http://www.dotnetfunda.com/articles/article121.aspx[^]
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
listbox is having more than one value....
how to get those value to one string?
|
|
|
|
|
Hi,
well you could iterate through the listbox-items and concat their text-properties. Just something like this:
StringBuilder oBuilder = new StringBuilder();
foreach(object oCurItem in myListbox.Items) {
oBuilder.Append(oCurItem.ToString());
}
string sResult = oBuilder.ToString();
Let me know if this helps you.
Regards
Sebastian
|
|
|
|
|
StringBuilder sb = new StringBuilder();
foreach (string s in listBox1.Items)
sb.Append(s);
|
|
|
|
|
string s = "";
for (int i = 0; i < lstSelected.Items.Count; i++)
{
if (s != "")
{
s = s + "," + lstSelected.Items[i].ToString();
}
else
{
s = lstSelected.Items[i].ToString();
}
}
But S-->is getting "System.Data.DataRowView" value instead of listbox item.
|
|
|
|
|
Try to use
<br />
<br />
((System.Data.DataRowView) lstSelectedItems.Items[i]).Item[0].ToString()<br />
<br />
instead.
|
|
|
|
|
StringBuilder s = new StringBuilder();
for (int i = 0; i < lstSelected.Items.Count; i++)
{
s.Append(lstSelected.Items[i].Text);
}
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
foreach (DataRowView item in listBox.Items)
{
txtBox.Text += item.Row["RowNameYouWant"].ToString() + "\n";
}
|
|
|
|
|
i wanna know how to create random numbers in c#. in my application i need to provide a default password if the user forgets the password. i wanna give this default password in the form of random numbers. pls help...
|
|
|
|
|
|
Hello Givya,
Have you tried searching[^]?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi
Use Random class like
Random r = new Random();
givya wrote: in my application i need to provide a default password if the user forgets the password
IMO ,If possible try to provide forgot password functionality like [Hint Question or Alternate Email]...
himanshu
|
|
|
|
|
I gave the following code to generate the random string(searched it on internet).
private string RandomString(int size, bool lowerCase)
{
StringBuilder builder = new StringBuilder();
Random random = new Random();
char ch;
for (int i = 0; i < size; i++)
{
ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65)));
builder.Append(ch);
}
if (lowerCase)
return builder.ToString().ToLower();
return builder.ToString();
}
Bt its giving the following error:
A using namespace directive can only be applied to namespaces; 'System.Text.StringBuilder' is a type not a namespace
I hav used this also: "using System.Text.StringBuilder;"
Pls help
|
|
|
|
|
Hi.
i get system date in this format "mm/dd/yyyy" like "07/15/2009" now i want to change date format like this "15-JUL-2009"
how can i do??
thanks in Advance
jawad khatri
|
|
|
|
|
|
Try this
DateTime dt = DateTime.Now;
MessageBox.Show(dt.ToString("dd/MMM/yyyy"));
<pre>
<div class="ForumSig">Regards,
Karthik K...</div>
|
|
|
|
|