|
HI I am new to the VB.net world, I am actually a student having a tough time with an assignment. The assignment wants me to make a software company. They sell three packages. Package A 99.00, Package B 199.00, PackageC 299.00. For buying a certain amount of quantity you get a discount.
Quantity discount
10 through 19 20%
20 through 49 30%
50 through 99 40%
100 or more 50%
With this I am suppose to have two messageboxes, one showing the amount of orders and one showing the grand total. With the grand total one I am supose to have a check box. Im really quite confused and ANY help that ANY one can give me I would be great appreciative! I have been working non stop on this and I dont' think I have made much progress.
Thanks!
|
|
|
|
|
KristineB wrote:
With this I am suppose to have two messageboxes, one showing the amount of orders and one showing the grand total.
Are you sure you're suppose to have message boxes? Or do you mean dialogs? or Text boxes on a dialog?
KristineB wrote:
Im really quite confused and ANY help that ANY one can give me I would be great appreciative!
That is a bit vague. Can you narrow it down to something more specific?
KristineB wrote:
I have been working non stop on this and I dont' think I have made much progress.
So, what have to managed to get working so far, and what is still broken? Why not take the broken bits and work on them one at a time (if you are still stuck then you can ask here again with specific details on the bit you are stuck on)
If you take the problem and work on it bit by bit then it does make thinking about it a lot easier and less daunting. An easy thing to do is to make a list of everything still to do/get working and go through it.
I hope this helps, and just let us know if there is any particular part you need help on.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
I can't seem to get the if/then/elseif to work on the %'s. the messagebox when I try to put in the controlchars.CrLf will not work. Pretty much everything. I try to write a line for the multiplication of the %'s and I am getting no where. Does that help?
|
|
|
|
|
The if/then/else part first:
' At some point in the code quantity is defined some how
' For example:
Dim quantity As Integer
quantity = 20
' The code will have to work out the discount.
' For example:
Dim discount As Double
discount = 0.0
If quantity >= 10 And quantity <= 19 Then
discount = 0.2
ElseIf quantity >= 20 And quantity <= 49 Then
discount = 0.3
ElseIf quantity >= 50 And quantity <= 99 Then
discount = 0.4
ElseIf quantity >= 100 Then
discount = 0.5
End If
Now, as for the multi line message box, you need to make sure the newline is defined properly. For example:
MessageBox.Show("My Multiline" + Environment.NewLine + "message!")
Environment.Newline is will always return the correct newline for the system. (Although I've not used it, I thing that if you were using the Mono framework [the open source version of the Class Runtime Library] on Linux it would just have the linefeed character, whereas on Windows it will have the linefeed and carriage return)
Does this help?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Yes thank you so much! I appreciate it!
|
|
|
|
|
One more question:
When I go to my design and want to write the code for btncalculate, so that it will pull a messagebox with the totals, what code would I write for it to take Packagea (99.00) and the txtpackagea (insert amount here) to realize the % and come up with the correct total? Does that make sense?
|
|
|
|
|
KristineB wrote:
Does that make sense?
Maybe... I'll explain my assumptions because I am not 100% sure what you mean.
* You have a variable called Packagea which has a value of 99.00 .
* You have a variable called txtpackagea which is a reference to the TextBox control
* You need to convert the text in the TextBox to a number in order to perform the calculation.
Try this:
Dim quantity As Integer
Try
quantity = Convert.ToInt32(txtpackagea.Text)
Catch ex As Exception
MessageBox.Show("The quantity entered for Package A is not a number")
End Try
Does this help?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Anyone here know if it would be possible to override the mouse click event when clicking on a POINT on a graph?
Basically, what I'm trying to do is, if the user clicks on a POINT on a graph, it will prompt him to enter comments on that particular point.
At the moment, if you double click on the graph, it will automatically open the edit chart dialog.
Anyways, if anyone can share some insight on the problem at hand, let me know.
Thanks,
Jon
|
|
|
|
|
You'd have to write code to map the mouse click onto the image of the chart and then determine if the mouse click actually hit the POINT on the graph. But, that would require your code knowing exactly where each point was in the chart image. As far as I can tell, there is no way of determining that...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I want to secure a MSAccess database by a password in such a way that when my programe open it by using ADODC then no password should required but when this database is opend on any system where Access is installed then it should require password.
Thanx
|
|
|
|
|
Plain old not possible, it's all or nothing...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I want to add "Enter kay option" in a VB database project at the time of its installation. The innstal wizard is prepared using "Package and Deployment wizard".
advance thanx for cooperation.
Kashif
|
|
|
|
|
You should use Install Shield to create package. Its very good and supply functions to create key option
Good luck
tramdtt
|
|
|
|
|
Hi,
I'm trying to create a little service that connect to a SQL database.
I'm using USER ID and password for authentication and everytime I try to open the connection I receive the following error :
System.Security.SecurityException: Échec de la demande pour une autorisation de
type System.Data.SqlClient.SqlClientPermission, System.Data, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089.
at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet granted
Set, PermissionSet deniedSet, CodeAccessPermission demand, PermissionToken permT
oken)
at System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken,
CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, Int32
unrestrictedOverride)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, S
tackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.Data.SqlClient.SqlConnectionString.Demand(SqlConnectionString const
r)
at System.Data.SqlClient.SqlConnection.Open()
at HEG_Console.Module1.Main() in P:\Mes Documents\Visual Studio Projects\HEG_
Console\Module1.vb:line 21
Here is my little little code :
<br />
Dim cObjConn As SqlClient.SqlConnection<br />
Try<br />
cObjConn = New SqlClient.SqlConnection("Initial Catalog=Northwind;Trusted_Connection=true;USER ID=myUser; Password=myPassword;Data Source=myServer")<br />
cObjConn.Open()<br />
<br />
Catch se As System.Security.SecurityException<br />
System.Console.Out.Write(se.ToString)<br />
End Try<br />
Does any1 know where I'm wrong ?
thx
|
|
|
|
|
Try dropping the "Trusted Connection" portion of your connection string. Also, make sure that the UserName and Password is setup correctly in the SQL Manager so that the ID has the correct rights to the database it's supposed to.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
back from holiday....
The problem is not in that way. I've heard something about a policy that you have to create to establish a trust connection between the client and the server when there aren't running on the same computer.
|
|
|
|
|
It's not so much a policy ... I think this[^] is what your referring to...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Your right but I've heard about a method to use with application.
I've got about 500 Pc and I don't want to add all one by one on my windows 2000 Server which is not an Active Dir.
|
|
|
|
|
In that case, you can't use a trusted connection. Since all of your machines are not in the same domain, you can't use the same username/password (or SID) for each user that accesses your SQL server. A better method to use, in your case, would be SQL authentication using an SQL user ID and password that is specific to the database you want. This actualy offers you better security because the SQL user ID doesn't have any rights to any other part of the server that is hosting your SQL server. This means that the ID can't be used to open any shares on that box, or anything else for that matter, just the database, tables, views, stored procedures, ... that you specify in the SQL Enterprise Manager.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm already trying to connect with an SQL user.
this is why I don't understand the error I got !
|
|
|
|
|
I am reading this XMLnode file nad filerting with 2 id's I m getthing back rwoa but I want to make one CustomerID column as hyperlink so when user click on it . they can pass that CustomerID to next page ...
Dim node As XmlNode = ResultAllCustomers(ar)
'Dim ReadNode As XmlNode = node.SelectSingleNode("DATA")
Dim eventID As String
Dim venueID As String
Dim ReadNode As XmlNode = node.SelectSingleNode("//row[@EID='" & eID & "' and @VID='" & pID & "']")
Dim Reader As New XmlNodeReader(ReadNode)
Dim mydataset As New DataSet
mydataset.ReadXml(Reader)
DataGrid1.DataSource = mydataset
DataGrid1.DataBind()
any suggestions how to do that???
|
|
|
|
|
I want to launch outlookexpress with hyperlink inside of body.
just like you might see when you select text and go insert -> hyperlink
to put the hyperlink.
ShellExecute Me.hWnd, "open", "mailto:dddd@mydomain.com?Subject="hello"&body="ClickHere", vbNull, vbNull, SW_SHOWNORMAL
When I run what only get simple text with ClickHere in outlookexpress
I want this to be hyperlink. how can I achieve this?
Development Environment : VB6
Shin
|
|
|
|
|
I am not sure if this is the proper forum...
I am looking to create a VB.NET based Forms App that will interact with a Web Service. I want to have a main/UI thread that spawns a thread to handle the web service. How do I then, communicate between the two once this is done? I will need to have the Web Service handling thread send information back to the UI, but also have the UI thread send new information back.
Can someone point me in the right direction or to some articles? I haven't had much luck and, with what I have found, have more questions than answers.
|
|
|
|
|
|