|
Hi Vuyiswa
I have the BLL and DAL all in codes in class objects. Although I have managed to convert your design time controls like datasets and adapters to codes. I am having difficulty in making the following CheckRules codes to work with my datasets in class objects.
I understand the DAL is Prop_DAL but don't know what to substitue for dsProperty and also Dim row As Prop_DAL.dsProperty.ClientsRow
Can you please clear out this for me.
Private Sub CheckRules(ByVal dsdata As Prop_DAL.dsProperty)
Dim strMsg As String
Dim row As Prop_DAL.dsProperty.ClientsRow
'Iterating through the Dataset and Checking the Rules
For Each row In dsdata.Clients.Rows
If row.RowState = DataRowState.Added Or _
row.RowState = DataRowState.Modified Then
'Start Checking the Rules now
If row.Client_Name.Trim = "" Then
MsgBox("Name Cannot be Empty")
End If
If row.Client_Address = "" Then
MsgBox("Address Cannot be Empty")
End If
If row.Client_ID.ToString.Length > 13 Then
MsgBox("ID number must less than 13")
End If
End If
Next
If strMsg <> "" Then
'throw a new ApplicationException
'with our Custom Error message in it
Throw New ApplicationException(strMsg)
End If
End Sub
|
|
|
|
|
hi Galle
Sorry For a Late Answer, bussy uhh
, to Answer your Question Marks ("Nice English")
The Code Below was based on a Wizard. This was my First Demostration of the N-Tier, and from there i demostrated on how to code all that the wizard can do for you and do what the Wizard cannot do. Now i see you have a Problem interpreting this in vb.net , because i have written my other articles in C#.To go back to your Question
If you Look at the Following Code
Private Sub CheckRules(ByVal dsdata As Prop_DAL.dsProperty)
if i were to Write it Without a wizard, it would look like this
Private Sub CheckRules(ByVal dsdata As Dataset)
and in the Following, remember that my table name was Client name.
Dim row As Prop_DAL.dsProperty.ClientsRow
In this code , we are creating a row object. So the difference here is to create a row object and dont reference it to the DAL wizard Dataset.
Dim row as dsdata
Hope this Helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Thank you...
I did go through your C# codes and they are very good. Hey, your comments about my english "Nice English" was it a joke? I am not offended, if not so.
|
|
|
|
|
No its a Joke, In South Africa we have this Commedian who makes jokes about being a Priest. So he always breaks his English for the sake of his audience
Dont worry i wouldnt attempt to upset you
Am Glad you you got help from my code
Thank you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Public Function Rating(ByVal iNPS As String, ByRef iRatings() As String) As String
Select Case iNPS
Case "1/2"""
iRatings = {"150#", "300#"} 'This is the line where I get an error
End Select
End Function
In the error list I get an "Expression Expected" error. I'm trying to return a string array so I can populate a combobox for a user. Any help would be much appreciated.
Eric.
|
|
|
|
|
Public Function Rating(ByVal iNPS As String, ByRef iRatings() As String) As String()
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Thank you for replying so quickly. I tried your suggestion and I still have the same problem. I am using vb.net express 2008. The blue squiggly line is under the first(opening) bracket.
|
|
|
|
|
Public Function Rating(ByVal iNPS As String, ByRef iRatings() As String) As String
Select Case iNPS
Case "1/2"
iRatings = New String() {"150#", "300#"}
End Select
End Function
|
|
|
|
|
You don't need to put a ByRef array in the header. You just need:
Public Function Rating(ByVal iNPS As String) As String()
Dim result As String()
Select Case iNPS
Case "1/2"""
result = New String() {"150#", "300#"}
.
.
.
End Select
Return result
End Function
|
|
|
|
|
I would like to known the name of an object that always appears describing a list of properties.
For example, when I am adding nodes to a treeview control it always appears an object that it's like a list box, but its categorized containg all the properties of each node.
I would like to use this object in my application, but I known even its name.Does anyone can help me?
Thanks,
Estevão
|
|
|
|
|
|
PropertyGrid[^]?
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
Yes thats the GridProperty control..thanks a lot!!!!
|
|
|
|
|
Is it possible to compile against .Net 2.0 and 2.1 framework versions in VS 2008?
I have the Advanced Compiler Settings screen open and am looking at the framework versions listed. 2.0, 3.0, and 3.5 are listed. The problem is that I need to compile apps under 2.0 and 2.1. Is this possible?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
There's such thing a .NET Framework 2.1. The valid versions are:
1.0 and 1.0 SP1, SP2, and SP3
1.1 and 1.1 SP1
2.0 and 2.0 SP1 and SP2
3.0 and 3.0 SP1 and SP2
3.5 and 3.5 SP1
|
|
|
|
|
My bad. For short hand at work, we call 2.0 SP1 simply 2.1.
Is it possible in VS 2008 to target 2.0 and 2.0 SP 1 specifically during compile time?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
No, you can only target a specific version, not a specific service pack.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Sigh. I was afraid that would be the answer.
Great feature in VS2008, but should more power to target a specific framework version (down to the SP level).
We still have to support Win98, meaning 2.0.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
The fact that .NET versioning is even included in Visual Studio 2008 should be good enough (unfortunately no 1.1 support though). What do you want specifically from the different service packs? Nothing really new is introduced, just fixed. If you want to target a particular service pack of the .NET framework, then make it a requirement of the program.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
In our organization, it is simply not possible to upgrade all clients mainly because we have *alot* of machinery that is controlled via apps originally created for DOS/Win98; and there are compatibility issues with newer versions of Windows. We could upgrade machinery which in turn would support a newer Windows version, but that costs are entirely to high for something that currently works fine esp. in a recessionary period.
We have several apps that we maintain and use for inventory control etc. In Win98, only 2.0 is supported. In WinXP+, we can support anything but tend to use 2.1 so that the same source files (95% of the time at least) can be used in compiling against 2.0 and 2.1. Currently we duplicate the .sln and .vbproj files to point at different compiled versions of referenced .dlls (2.0 vs 2.1).
It is nice that VS2008 allows you to target a framework, but in our scenario, it doesn't really help. Targeting a framework version, at least to me, would allow a developer to target a specific framework version regardless if it's the base version or a SP version; not just what ever version happens to be the latest.
In a perfect world, we would all run 3.5 and upgrade our OSs at M$s will......... but that perfect place doesn't exist here.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
kissdznuts wrote: In a perfect world, we would all run 3.5 and upgrade our OSs at M$s will......... but that perfect place doesn't exist here.
Agreed, Microsoft did it's job too well. People clinging to their old OS-es like there was no alternative.
|
|
|
|
|
What version of Visual Studio do you use to compile against 2.1?
Do you actually distribute a version with 2.0-framework libraries *and* a version with the 2.1-framework libraries?
kissdznuts wrote: We still have to support Win98, meaning 2.0.
I'm using VS2008, Windows XP SP3. Just compiled a form against the 2.0 framework, without problems. I didn't test it under 2.0 SP1 though.
|
|
|
|
|
Eddy Vluggen wrote: What version of Visual Studio do you use to compile against 2.1?
Currently using VS 2005 for compiling against both. I have 2 virtual machine environments setup so that I can compile against 2.0 and another for the 2.1 framework library.
Eddy Vluggen wrote: Do you actually distribute a version with 2.0-framework libraries *and* a version with the 2.1-framework libraries?
Two different library versions get deployed. Win98 gets the 2.0 librarys, while everyone else gets 2.1. If the machine isn't running Win98, they the client has WinXP or higher.
Eddy Vluggen wrote: I'm using VS2008, Windows XP SP3. Just compiled a form against the 2.0 framework, without problems. I didn't test it under 2.0 SP1 though.
Not sure I'm following you here. Are you saying you compiled a win form app targeting the 2.0 framework, and the app worked in Win98? I thought by default VS2008 installs 2.0 SP1?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
kissdznuts wrote: I have 2 virtual machine environments setup so that I can compile against 2.0 and another for the 2.1 framework library.
So you redistribute the framework-libraries with the installer?
kissdznuts wrote: Are you saying you compiled a win form app targeting the 2.0 framework, and the app worked in Win98?
I'm saying that there is no way to target 2.1 specific. One targets 2.0, 3.0 or 3.5. Microsoft only provides Redistributable Packages for those versions of the framework. You'll have to traverse the registry to find out wether SP1 is installed (or any security-updates for .NET, in case those DLL-versions are important to you)
Take a look at the version-list;
http://en.wikipedia.org/wiki/.NET_Framework_version_list
|
|
|
|
|
Eddy Vluggen wrote:
So you redistribute the framework-libraries with the installer?
Kinda - we have a custom app that is similar to the click once. We have an exe that starts prior to any other apps, determines what updates need applied and installs them (meaning frameworks, windows installer, other 3rd party software), and then runs the appropriate program (determine by command line sent in).
Eddy Vluggen wrote:
I'm saying that there is no way to target 2.1 specific. One targets 2.0, 3.0 or 3.5. Microsoft only provides Redistributable Packages for those versions of the framework. You'll have to traverse the registry to find out wether SP1 is installed (or any security-updates for .NET, in case those DLL-versions are important to you)
Right, that's what Guffa was stating earlier. Basically, the 2.0, 3.0, 3.5 points to the highest installed version of each.
I check the Net Framework Setup\NDP\v2.0\SP key or system.environment.version
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|