|
No, you cannot use System.Net.Sockets or anything Similar in .Net 1.1. You could try (if you use Vb6) downloading Visual Basic Studio 2005 Express and getting the .Net Framework 2.0 along with it. Otherwise, you probably won't be able to finish you're project.
Sorry.
|
|
|
|
|
I am a newbie in learning vb.net. Hope any would give me a hand of the problem. Here is the problem, i need to get all the data inside the listbox ad update to database. So, i use a for loop to save into database. But the data in the listbox can't be retrieved. I am very frustrated with this any help would be appreciated. Thanks.
Dim i As Integer = 1
Dim j As Integer = lbStockID.Items.Count - 1
For i = 1 To j
Dim stockcode As String = lbStockID.Items.Item(i)
Dim quantity As string = lbQuantity.Items.Item(i)
//Establish connection
Dim ConnInsSalesD As New SqlConnection("Password=''; Persist Security Info=True;User ID='sa';Initial Catalog=FYP;Data Source='.'")
Dim strInsSalesD As String
strInsSalesD = "Insert into SalesDetails Values('" & SDID & "','" & quantity & "','" & lblSID.Text & "','" & stockcode & "')"
ConnInsSalesD.Open()
Dim cmdInsSalesD As New SqlCommand(strInsSalesD, ConnInsSalesD)
cmdInsSalesD.ExecuteNonQuery()
ConnInsSalesD.Close()
Next i
|
|
|
|
|
What's the problem? "But the data in the listbox can't be retrieved" doesn't tell us anything. Does it work on one line and not the other? Does it retrieve the wrong value? Were there any error messages?
Your code says that there are TWO ListBoxes, not one. Is this correct?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for reply.
Yes, actually i need to store all the data from both listbox into the database, but the both line
Dim stockcode As String = lbStockID.Items.Item(i)
Dim quantity As string = lbQuantity.Items.Item(i)
give me the error message : Value of type 'System.Web.UI.WebControls.ListItem' cannot be converted to 'String'.
So what is the way to solve can i have way to get the data?
Thanks
|
|
|
|
|
Newbie_dydy85 wrote: lbStockID.Items.Item(i)
returns a ListItem and you are assigning it to a string. Use lbStockID.Items.Item(i).Text OR lbStockID.Items.Item(i).Value (as the case maybe) for both drop downs and that should solve the problem.
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
When you return the item from the ListBox, you have to call that objects .ToString() method, if there is one.
But, since your filling the ListBox with items, you shouldn't even need to get it from the ListBox. You already have the items stored somewhere else, right?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Been searching the web for a couple hours now with no luck. Does anyone know of any good sites that show implementing SSL with VB?
|
|
|
|
|
|
I have a class, class A. Within that class are defined multiple properties. (Gets and Sets). In the same project, I have a second class file, Class B. Class A's properties are public, but I am unable to access them from Class B, and when I try to pass Class A into Class B, it doesnt allow it, saying "Class A is a type and cannot be used as an expression". Not sure what I need to do to make Class A Accessible within Class B. Can anyone point me to where I need to go?
Thanks
|
|
|
|
|
What you need to do is post code. Best guess - you are trying to access them as ClassA.SomeProperty when they are not static. YOu need a class instance ( which holds the value for thqat instance only ) or to make them static ( which I think is Shared in VB )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Here is what I have, in Class A:
<microsoft.visualbasic.comclass()>Public Class ClassA
Private Shared propName As String
Public Shared Property strPropName() As String
Get
Return propName
End Get
Set(ByVal value As String)
propName = value
End Set
End Property
End Class
That will allow me to access it as a property directly within another class. (Thanks) However, these properties are set from a VB6 application, which then calls different methods within Class B. I can access the properties in Class B now, but they are not visible in the VB6 app anymore. I have the project setup for Com Interop, and can see everything else, just not the properties I set this way. Am I stuck with one or the other? Or is there a way to get both? I found that if I change the Public Shared Property to just Public Property, I can see it in the vb6 app, but not in the other classes within the project.
|
|
|
|
|
rahvyn6 wrote: Or is there a way to get both? I found that if I change the Public Shared Property to just Public Property, I can see it in the vb6 app, but not in the other classes within the project.
Sounds like you can have one or the other.
There's no way to do it without having something shared at some point.
One possible hack is to have a non shared property which, when called, sets or gets the shared one. So, you have a non shared property, which turns out to really be shared.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
That would be a major pain, I have around 150 properties.
|
|
|
|
|
Sure - I'm afraid I have no other suggestions.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
I want to know that how i get hdd serial no by codding in vb.net PLZ help me.
Thak You
Vikash Yadav
|
|
|
|
|
You need to use WMI to do this, and you also need admin access when your code is running.
There's plenty of examples on the web.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi I want how design salary slip data base in ms access and also please give me example project if possible in VB.Net
|
|
|
|
|
What is is that you have problems with; designing a database in Access, or the specific design of a "salary slip" database?
---
b { font-weight: normal; }
|
|
|
|
|
My Question is how we design the database for example just take the employee details and calculate his salary based on no of attended days . if particular employee get hike that also i have to calculate and then i want to show in view screen and then i display in crystal report.if i want to see all the employee details that also i will able to see .Back end is Ms Access and front end is VB.Net please Help me .
|
|
|
|
|
Is this your homework, or are you being paid to write this ? Either way ( but all the more if it's homework ), you need to take the first steps yourself, and ask *specific* questions when you get stuck on *specific* things. If you have no idea how to start, then either talk to your teacher, or let your boss know that you're being asked to do something that is out of your depth.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am a newbie of vb.net.Now i wanna draw some electronic circuit in vb.net.Anyway, i have found Image Editor tool which seems to be usable with this kinda drawing.Unfortunately, i cannot click it, They cannot be clicked to use.Could you please help me how to use it??
Thanks in advance.
|
|
|
|
|
I have no idea what tool you're talking about. To do what you want, you need to handle the paint event of your control/form, and draw your circuit. You can use the mouse events to handle drawing items and if you want to click on parts and select/interact with them, you need to keep each item in a list and handle selection from there.
vuthcam wrote: I am a newbie of vb.net
This probably means you didn't understand a thing I just said. That would be because an electronic drawing program is not a suitable choice for a first programming task. You probably need to write a few simpler programs to build the skill level necessary to approach this task. Ideally, you'd write some console programs first, although in my experience most people are too impatient to learn to code properly nowadays, especially in the .NET space, and doubly so in VB.NET. However, that's good advice, and you should consider taking it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I understand yours. Although i am a newbie it doesn't mean i understand nothing. Newbie of mine means than i don't have enough ability yet to code some big pro. But this i think it is something usual. We just draw the static pic of that circuit then to code it.
As i have said, i have found some kinda tools which is suitable to be used but i reall wonder that i cannot use it...ok i'll post something in my blog.I hope you can spend time for helping me ...thanks...it is very kind of you..
My Blog: www.vuth-it.blogspot.com
|
|
|
|
|
vuthcam wrote: Although i am a newbie it doesn't mean i understand nothing.
Fair enough - there are different ways to take the word 'newbie' and a lot of people are coding for the first time ever and trying to write complex code that is beyond them. I didn't mean to talk down to you, just to give good advice.
vuthcam wrote: As i have said, i have found some kinda tools which is suitable to be used but i reall wonder that i cannot use it
For this task you need to build the sort of framework I suggested, I would be surprised if you found something that did exactly what you wanted.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|