Thank you. I found some help here : http://www.eggheadcafe.com/articles/20051130b.asp[^] In fact here is the code : foreach (DataRowView drv in lbox.SelectedItems) { //Display column Id MessageBox.Show(drv.Row["Id"].ToString()); }
benqazou
Posts
-
Browsing a ListBox -
Browsing a ListBoxHey, Of course I've done many research before asking here.. The problem i have is not with getting the collection of selectediems (lbox.SelectedItems and lbox.SelectedIndices..etc) but when trying to retrieve the Value associated to a selecteditem.. Thanks.. for not helping..:-D
-
Browsing a ListBoxHey, I need to browse a multiselection ListBox, especially getting the Values of selected items. I filled it like this : lbox.DataSource = 'some datatable'; lbox.DisplayMember = "Col1"; lbox.ValueMember = "Col2"; The SelectionMode chose is : MultiSimple I need something like this foreach (item in the selected items) { Display its value.. etc } Thank you.
-
Session like variablesHello, Thanks gajatko for your help. Your code uses generics and SettingsClass that are not available in C# 1.1. How can I rewrite it to make it work in VS2003? Thanks. -- modified at 10:25 Monday 24th September, 2007
-
Session like variablesHello, In fact i've been misunderstood. I am talking about Winforms not Webforms. You know that in Webforms you have predfined classes that allows the persistence of variables (or objects) and sharing them between Webforms (Application and Session classes). What I want is to implement something similar in Winforms, i.e declaring some variable in Form1, and using it in Form2 .. FormN.. I guess that the first answer of gajatko would help. Thank you.
-
Session like variablesHey, I need to share variables among forms in the Web session (or application) manner. I used to have some code - which I don't have now- that implements the singleton design pattern and allows adding and retrieving objetcs this way :
Application["MyObject"] = object;
Can you help? Thanks. -
Global variables (WinForms)Hi, I have developped no more Winforms applications since quite long. I can't see how to create "global variables or objects" that would be shared among all the winforms? In the webforms I was used to Session variables, but with winforms..? Any clue to do the same? Or in message driven way? Any help is welcome. Thanks a lot.
-
Please HelpSalam, First, do you have an SMTP server installed on one of your machines?? Or do you have an email with SMTP support (free webmails like yahoo, hotmail..etc do not allow to send emails programmatically through their SMTP servers...) Once you have a valid SMTP server, here's some code to do so :
MailMessage mail = new MailMessage(); mail.To = "xxxx@yahoo.com"; mail.Bcc = "yyyy@yahoo.com; sersif@mce.gov.ma"; mail.From = "your email or name"; mail.Subject = "your subject"; mail.Body = "your subject"; mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "YOUR EMAIL USERNAME"); //set your username here mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "YOUR EMAIL PASSWORD"); //set your password here SmtpMail.SmtpServer = "10.4.1.2"; //your real server goes here SmtpMail.Send(mail);
-
rediobuttonHey, You need to set the radionbutton AutoPostback property to 'true'.. Then by double clicking the radiobutton, VS creates a method radiobutton_checkedchanger(..) where you write the code to enable the dropdownlist.. I'd rather suggest you use a checkbox instead of a radiobutton. Good luck.
-
When Send Email this error is occurThat's very likely because your machine (localhost) is not an SMTP Server. حظا سعيدا
-
Where in('aa','na'dn') ProblemIn fact these are two single quotes (not a double quote).
-
Where in('aa','na'dn') ProblemIf you were using SQL Server, you would have to write : select * from cars where car_make in('BMW','Mercedes','Accura','infin**''**it') For MySQL I am not sure, but try it this way.. I hope it'll work.
-
.net Language InteroperabilityHey, I don't have the magic solution for you, but just a remark. Your VC++ program compiles into an exe, because there it's designed to.. You can try to encapsulate the logic you need in it into a dll, but then you need to create another project.
-
why the web is stateless?This will illustrate my previous post : http://www.csd.uoc.gr/~hy556/notes/extra/HTTP/node5.html[^] Good luck.
-
why the web is stateless?Hey, The Web is stateless because HTTP is connectionless. That's to say for every ressource the a client wants, it(they) must send a request and wait for a reply. And that's all. There is no connection that is open at the beginning and maintained, but : A request and a reply for every ressource (html file, image, ..) -- modified at 11:46 Tuesday 4th April, 2006
-
How to store a password field in the SQL database?Hey, Here are some tips for a better password management: 1-Access to the user table (at least) should be very limited! 2-Do never store passwords as they are in the database; just store their hashes (or digest) (Look for md5 and c# for example in Google) Good luck
-
Erorr..!!Hey, IMO it's a configuration problem. I mean your application is not set as a Web application in IIS. To check this, run INETMGR (run command), look for your application folder and see if it's marked as a Web application.. Good luck.
-
asp.net vs phpAssalamu alaikum, You can use PHP with almost any RDBMS, all you may need is to install a specific provider to each RDBMS. For .Net it is the same, you can use MySQL as well as any other RDBMS. Good luck.
-
What is the datatype of a control's width property?Hey, Clearly the width property is always an integer. The problem (I guess) in your code is that
Me.width * (test/100)
is not always an integer (eg. test = 3.. or so) But a float.. And C# (or VB.Net) does not convert (or cast) implicitly an integer into a float or decimal.. Just try this :label1.width =(int) Me.width * (test/100) //C# not VB
Good luck. -
Client EmailsIs this what you mean by your first question :
[tell a friend](mailto:someone@somewhere.com?subject=look at this website&body=Hi, I found this website and thought you might like it http://www.geocities.com/wowhtml/)
?? -- modified at 9:22 Monday 27th March, 2006