|
Ha.
Thanks.
I can use that with System.IO.DriveInfo to get what I need.
That's what I love about CodeProject... response within a half hour.
------------------------
using System.People;
Person me = new Person();
me.Certifications = null;
me.Experience = little;
me.WantsToLearn = true;
me.InSchool = true;
me.AskQuestions("C# .NET 2003");
|
|
|
|
|
plz help me i have made Window Applcation and i want to save the exe in Startup. how it is possible
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wli
|
|
|
|
|
Sanjib Raj wrote: Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wli
sanjit, there are so many other ways to memorize your email id. This looks really awkward. Please remove them from your signature.
Sanjib Raj wrote: plz help me i have made Window Applcation and i want to save the exe in Startup. how it is possible
The simple way is to create a shortcut to theStart Menu\Programs\Startup folder
:Gong: 歡迎光臨 吐 西批 :Gong:
|
|
|
|
|
Hi,
If you want your programme in the start up than put the path in the registry for startup..
nishu
|
|
|
|
|
Dear all.
i am making web application using asp.net and C#(Visual studio 2005). i have listbox(with multi select option) on web form. I am able to capture data through loop. now i want to know how i can place this loop data into single statement for insert statement.i am using prepared statement that is my insert query is
"insert into agentmst(agentid,agentname,agentservice1,agentservice2,agentservice3,agentservice4,agentservice5,branchid,acreatedby,acreated,Ipadd) values(@aId,@aname,@serv1,@serv2,@serv3,@serv4,@serv5,@branchid,@crby,getdate(),@ip)";
(i am ristricted myselef to atmost five listbox option).now i am populating listbox option as
parm3.ParameterName = "@serv1";
parm3.Value = names[0];
parm4.ParameterName = "@serv2";
parm4.Value = names[1];
parm5.ParameterName = "@serv3";
parm5.Value = names[2];
parm6.ParameterName = "@serv4";
parm6.Value = names[3];
parm7.ParameterName = "@serv5";
parm7.Value = names[4];
now i am able to fetch listbox data correctly through loop as
for (int i = 0; i < listBox1.Items.Count; i++)
{
if (listBox1.Items[i].Selected == true)
{
for (int j = 1; j < 7; j++)
{
names[j] = listBox1.Items[i].Text;
Response.Write(names[j]);
break;
}
}
}
Now my question is how i can use this in insert statment. Please Guide me.
Where i am going wrong.
Any one knowing Please guide me.
Thanks
regards
imran khan
|
|
|
|
|
remember that the listbox in this powerfull lenguage c#, have many components that you can use in your project, for intance, only you need load the information in a datatable for example, and then tell to the listbox, and you can use too a combobox, the properties datasource that you load from a datatable:
public void LoadDatatable(ref system.data.datatable some)
{
cmd = new SqlCommand("yourStoredProcedureOrStatement",con);
cmd.CommandType = CommandType.StoredProcedure;
try
{
adapt = new SqlDataAdapter(cmd);
adapt.Fill(some);
}
catch(Exception ex){throw ex;}
finally
{
con.Close();
}
}
system.data.datatable p=new system.data.datatable();
LoadDatatable(ref p);
and after all this, only rest that you tell to the combobox or listbox, anyone that the properties DataSource = p;
and the way too show the thinks that was load:
ListBox.DataSource = p;
ListBox.DisplayMember = "The name of the thinks that you like show";
ListBox.ValueMember = "A id, if exist, only to give more handle to this control";
ok I hope that this thinks help you....
one think: Forgive me by my English ok, because in my contry this idioms i'snt speak a lot....
if you wanna another answer o whatever please write me
e-mail:joelintel@gmail.com
|
|
|
|
|
Thanks for reply.
But i already filled the listbox in page load event. Now On Save Button, i have to get those selected item in the listbox. and add to the parameter.
My quetion is how can i assaign these selected option values to parameter used.
regards
imran khan
|
|
|
|
|
sorry for the long time, but I can'nt seat before my pc in some many hours, ok your question is simple
the best mode to give you the answer is with a example....
if you have a listbox and in them properties selection mode you put "MultiSimple", and you do a correct add of the elements to show in run time, you selected the item that you need to save in your DB maybe using that
int [] a;
int p=0;
p=this.listBox1 .SelectedIndices.Count ;
a=new int[p];
for (int i = 0;i < p;i++)
a[i] = this.listBox1 .SelectedIndices [i];
and in the array "a" you have all the position that be selected, the rest i think you know, make a loop wih that and with the class SqlParameter add all this position or the name of the item under this position....
is a plaesure help you, if you have any question tell me ok....
|
|
|
|
|
hi, in the last reply, I show you how you can select the rows in a listbox, but how you no tell my any more, I expect that you stand all....
regards
sno-1
|
|
|
|
|
sir
i want multiselect listbox how to save in database please coding and query
|
|
|
|
|
i have made a system tray in WindowApplication C# i want to run it when System Starts as Sql Server Service manager Starts or System Tray will start automatically, plz help me?
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wli
|
|
|
|
|
Sanjib Raj wrote: Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wlinktech.com
Sanjit.rajbanshi@wli
I've sent the answer to your Sanjit.rajbanshi@wli id. Good luck.
:Gong: 歡迎光臨 吐 西批 :Gong:
|
|
|
|
|
Hi all,
please can anyone explain me what r saf and unsafe keywords?
thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
http://msdn2.microsoft.com/en-us/library/ms228628.aspx[^]
Instead of wasting yyour time in the forum for nearly around three hours, u can as well search such small things in google to save time!!!
All the Best
"Change is the only constant thing in life
Either or survive or get extinct"
|
|
|
|
|
hi chravisankar,
thanks for the reply. generally i Use google & msdn2.microsoft.com for the subject. i am learning .net all by myself.
sometimes i am confused when i accross the new terms. i post the query in this forum, when i am frustated to understand the subject by myself and hoping that someone can answer my question in a simple way.
anyway thanks once again for responding to my question
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I am fairly new to .Net and C# but have what I hope is an easy to answer question. I have a Windows form with a menuStrip and a statusStrip. I am wanting to have the MouseEnter event determine which menu the mouse is over and update the statusStrip label accordingly. Can someone please help?
Thank you.
centershot
|
|
|
|
|
What you would want to is use the MouseEnter event for the MenuItem itself (ex "exit").
private void Form1_Load(object sender, EventArgs e)
{
exitToolStripMenuItem.MouseEnter += new EventHandler(exitToolStripMenuItem_MouseEnter);
}
void exitToolStripMenuItem_MouseEnter(object sender, EventArgs e)
{
lblOnStatusStrip.Text = "This is an Exit Function.";
}
hope this helps
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hi,
I am coding a game and I want to give user a little time when he/she presses a button. So I created a Thread object but VC 2005 gives error in the function which i bound to the thread. Like that:
private void timer1_Tick(object sender, EventArgs e)
{
if (..sth...)
{
Thread t = new Thread(new ThreadStart(ThreadProc));
t.Start(); }
}
public static void ThreadProc()
{
Thread.Sleep(1000);
((Button)selectedButtons[1]).Enabled = false;
((Button)selectedButtons[1]).BackgroundImage = null;
selectedButtons.Clear();
}
It says:
An object reference is required for the nonstatic field, method, or property 'finalstand.Form1.selectedBtns'
Any Suggestions?
Note: filestand is the name of the project
|
|
|
|
|
What is selectedButtons ? and selectedBtns ?
maybe best to show more of the code...
Luc Pattyn
|
|
|
|
|
I mean that I want to freeze the program one or more seconds and then change the properties of some buttons.
SelectedButtons (actually it was selectedBtns but i changed it while i am copying it to here) is the Arraylist which I added some Button objects in it. Namely, in the thread function I want to reach these ArrayList (and buttons in this ArrayList of course) and change them.
But if there is an another way to freeze the program, I am open to new ideas.
Thanks
|
|
|
|
|
Guffa is right of course. Why make ThreadProc() static ?
I am still uncertain about your intent. Seems like a button, once pressed,
gets disabled one second later ?? At best this is an attempt to inhibit multiple clicks. But what if it is pressed sooner ? and how do you re-enable such button
(it is not in the ArrayList anymore).
Luc Pattyn
|
|
|
|
|
You can't access an instance member from a static method.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
I think you maybe use Invoke function, because you want to change some controls which is in the main thread.
E.G.
*********
public static void ThreadProc()
{
Thread.Sleep(1000);
base.Invoke(new EventHandler(this.ReallyClick));
}
private void ReallyClick(object sender, EventArgs args)
{
((Button)selectedButtons[1]).Enabled = false;
((Button)selectedButtons[1]).BackgroundImage = null;
selectedButtons.Clear();
}
**********
experiment it
|
|
|
|
|
I think this is the thing I am looking for. But when I try this it says:
Error 1 : Keyword 'base' is not available in a static method
Error 2 : Keyword 'this' is not valid in a static property, static method, or static field initializer
Do you know why?
|
|
|
|
|
make your control a static one, also the function you are passing to the event handler.
public static System.Windows.Forms.Button btnClose;
then, you cannot use "this" inside a static method. instead, make your method static and give it's name without "this.".
eg
<br />
public static void reallyClick()<br />
{<br />
}<br />
:Gong: 歡迎光臨 吐 西批 :Gong:
|
|
|
|