from a listbox to a database
-
hi im wondering how do i take a selection from a list and store it in a database...do i have to 1. make the selection 2. take the selection and store it into a string 3. store the string into the database or 1. make the selection 2. store it into the database by doing this "INSERT INTO Pharmacy ListboxColumn Values '"+listbox.selecteditem+"'"; also how do i take multiple selection and store it in a string? txh in advance
-
hi im wondering how do i take a selection from a list and store it in a database...do i have to 1. make the selection 2. take the selection and store it into a string 3. store the string into the database or 1. make the selection 2. store it into the database by doing this "INSERT INTO Pharmacy ListboxColumn Values '"+listbox.selecteditem+"'"; also how do i take multiple selection and store it in a string? txh in advance
ASGill wrote: store the string into the database Look and search for
SqlCommand
,SqlDataAdapter
in MSDN and this site for sample. ASGill wrote: . take the selection and store it into a string Look forListBox.SelectedValue
in MSDN Mazy "A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope -
ASGill wrote: store the string into the database Look and search for
SqlCommand
,SqlDataAdapter
in MSDN and this site for sample. ASGill wrote: . take the selection and store it into a string Look forListBox.SelectedValue
in MSDN Mazy "A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hopegot it working mazdak!....thx alot for ur directions.. anyways, im kinda curious here.... when i've completed my app and i'd have to present it in a networked environment..what do i need for my app to run on a completely different machine...like Java's got their Virtual Machine (JVM) and such..also pls tell me the list of OS's thats compatible with a .Net app. i know i can get all this info from the internet...i just wanna doubl confirm..so that im not doin anything wrong.. also...im trying to implement a splash screen, how do i start my app with splash screen first... i tried [STAThread] { Application.Run(new frmSplash); } but then the splash screen does not wanna close at all...how do i go about this. oh yeah and another thing...can i have your name...i'd like to add it in my acknowledgement and also referrence. thx in advance Arvinder Gill
-
got it working mazdak!....thx alot for ur directions.. anyways, im kinda curious here.... when i've completed my app and i'd have to present it in a networked environment..what do i need for my app to run on a completely different machine...like Java's got their Virtual Machine (JVM) and such..also pls tell me the list of OS's thats compatible with a .Net app. i know i can get all this info from the internet...i just wanna doubl confirm..so that im not doin anything wrong.. also...im trying to implement a splash screen, how do i start my app with splash screen first... i tried [STAThread] { Application.Run(new frmSplash); } but then the splash screen does not wanna close at all...how do i go about this. oh yeah and another thing...can i have your name...i'd like to add it in my acknowledgement and also referrence. thx in advance Arvinder Gill
For your first question you need to install .NET framework on each machine you want to run your application. Also if you use ADO.NET (which you used) you need to install latest version of MDAC on that machine, specially if that OS is not WinXP. About spalsh screen, I haven't done it myself in C# but if you want to put it before Application.Run() you have to close before it too cause that line actualy doesn't finish until you close your application. You can first show splash, then use sleep function for wait some seconds,then close it. Same thing can be done in Load event too, but I don't know best solution until I test it myself. ASGill wrote: can i have your name... Well, you already know it. My name is Mazdak. Mazy "A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
-
For your first question you need to install .NET framework on each machine you want to run your application. Also if you use ADO.NET (which you used) you need to install latest version of MDAC on that machine, specially if that OS is not WinXP. About spalsh screen, I haven't done it myself in C# but if you want to put it before Application.Run() you have to close before it too cause that line actualy doesn't finish until you close your application. You can first show splash, then use sleep function for wait some seconds,then close it. Same thing can be done in Load event too, but I don't know best solution until I test it myself. ASGill wrote: can i have your name... Well, you already know it. My name is Mazdak. Mazy "A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
-
ASGill wrote: what's MDAC??... Microsoft Data Access Component. http://www.microsoft.com/downloads/results.aspx?productID=&freetext=mdac&DisplayLang=en[^] If you use updated WinXP you have latest version already but it is not included in other OSes. Mazy "A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope