|
Hi ,
I want to develope an urdu/arabic based database application usin vb.net and SQL Server 2000 any one can
help me how i can do this .If anyone can give Code Example in any languge
|
|
|
|
|
You can do it by using Resource files
Resource files have the values for the controls etc.
In resource files u save the value in your desied language
Get the values from these resource files to display.
Hema Chaudhry
|
|
|
|
|
I've almost solved this problem by
using unicode whiles inerting into db and
converting unicodes back to Actuall text while
displaying in a listview. But now i've another problem
if you can solve this , i'll be much thankful to you
as i need an urgen solution .The problem is that
my idea of converting Text to Unide Code then back to
text doesn't work with Crystal reports . If you can help me
how to convert unicodes (Which are now stored in db)
to Actual text for Report.
Many thanx
HMSS
|
|
|
|
|
Sorry but i have no idea about crystal reports
Actually I m also facing this problem
If u get the solution Please Mail me also
Its a great help fro me.
|
|
|
|
|
Sorry but i have no idea about crystal reports
Actually I m also facing this problem
If u get the solution Please Mail me also
Its a great help for me.
hema chaudhry
|
|
|
|
|
Hello everyone,
I'm making a call to a native DLL on a PocketPC 2003 device via pinvoke. I have the call working fine in an eVB demo but it is returning a Not Supported Exception error when I call it in VB.NET.
I'm trying to find some docs on how/why the Not Supported Exception error is thrown but can not find anything useful. Can anyone point me in the right direction?
Thanks!
Ryan Bradley
|
|
|
|
|
This problem evolved through a couple of different error messages.
The NotSupportedException was thrown when I passed a System.String ByRef to a BSTR in the non-COM DLL.
I finally realized that I needed to use a StringBuilder. This resulted in a Native Exception (0xc0000005). Memory wasn't being marshalled properly between the unmanaged stack and the managed heap.
Originally I was using <DllImport("")> and passing StringBuilder ByRef (resulting in Native Exception). I finally got this to work using Declare Function "" and passing StringBuilder ByVal.
I've read through the CF Core Reference and numerous web sites but have not found the defaults that are different between using DllImport and Declare Function .
I did find that MarshalAs is not possible in CF 1.1. I'm stumped why but it works.
Dysfunctional:
<DllImport("ReaderDll")> _<br />
Public Function Read(ByVal strbData as StringBuilder) as Integer<br />
End Function
Functional:
Public Declare Function "Read" Lib "ReaderDll" (ByVal strbData as StringBuilder) as Integer
Ryan Bradley
|
|
|
|
|
When I try to create a new project I get a run time error message that says "Automation server can't create object". What am I doing wrong?
|
|
|
|
|
You don't have the correct references or components defined in your project. You'll need to review them and correct where necessary.
...Steve
|
|
|
|
|
Can a report source be a datasource?
Thanks!
|
|
|
|
|
Property Pt1() As POINT
Get
Return Me._Pt1
End Get
Set(ByVal value As POINT)
If value = Me._Pt2 Then
' TODO: Invalid Point (same as PT2)
Else
Me._Pt1 = value
End If
End Set
End Property
In my property code (above) for the 1st point in my line class, the if statement produces squiggly (wavy underline) warning saying: Operator '=' is not defined for types 'POINT'.
How do you define an 'operator' in a class definition? I have yet to find this concept in the book.
Thanks,
Karen
Nooobie to OOP and VB.Net 2005
|
|
|
|
|
It doesn't matter that you are in a class, the error says you can't use = to compare Points.
Taking a quick look at the library for the Point type I see you can use the equals method:
Dim a As New Point(0, 10)<br />
Dim b As New Point(1, 10)<br />
Dim c As New Point(0, 10)<br />
If a.Equals(b) Then Debug.WriteLine(" a = b") Else Debug.WriteLine(" a not = b")<br />
If a.Equals(c) Then Debug.WriteLine(" a = b") Else Debug.WriteLine(" a not = b")
|
|
|
|
|
There is a critical distinction you need to make:
1) Do you want to know if the two objects are really the same? In other words, are you passing in a second reference to a single instance of the object?
2) Do you want to know if the state of two different object instances are identical. In other words, you have two separate object instances, but their property values, i.e their state, is identical.
In the first case there is a comparison operator - "Is". Example
boolTest = m_Object1 Is m_Object2
If this returns true, you have a single object instance that is being referenced by two pointers - m_Object1 and m_Object2.
In the second case, the simplest approach is to write your own validator function in the class that performs a memberwise comparison of two objects, such as
Private Function IsObjectStateIdentical(ByRef MyPoint1 As POINT, ByRef MyPoint2 As POINT) As Boolean
Dim fIsIdentical As Boolean
With MyPoint1
fIsIdentical = (.X = MyOvbject2.X)
fIsIdentical = fIsIdentical And (.Y = MyObject2.Y)
End With
Return fIsIdentical
End Function
|
|
|
|
|
Hi all,
Can any one please tell me how can i add a bacground music with user control (user can control , volume, mute etc) by using VS, VB, ASP.net web application.
Regards
Jennifer Wadhani
jenniferaahmed@yahoo.com
|
|
|
|
|
VB can't play music in a web application. ASP.NET is a server-side only technology that generates HTML for browsers. If you want music in your web page, you'll have to do research on HTML and Web methods of doing that.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Just curious.
From my recent reading ("Coding Techniques for Microsoft Visual Basic.Net" - Table 4-1), I noticed that a Boolean variable took 4 Bytes of storage and a Byte variable only took 1 Byte.
It's clear why a Byte equals a Byte, but why on earth does a Boolean (who's only values can be either a 1 or 0) require 4 Bytes?
Was this a typo?
Thanks,
Karen
Nooobie to OOP and VB.Net 2005
|
|
|
|
|
A boolean in the .NET Framework is not just a single bit, but is a structure with a couple fields and a bunch of methods. Internally, the boolean value is stored at an Int32, or 32-bit value, I think(!).
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The system memory bus is 4 bytes (32 bits). The minimum packet of information along this bus then is 4 bytes. The common language runtime decides the actual size of the boolean at runtime. Typically it will use 4 bytes as this is the most efficient. If memory is at a premium, then it can reduce the size on the fly. On 64 bit architecture it will use 8 bytes.
|
|
|
|
|
Thanks to all. My goal is to learn the right way to design tight classes. Soooo on today's 32 bit system, using less than 4 Bytes is inefficient.
This is beginning to make sense -- I also read using a 'int16' or 'short integer' (2 Bytes) is less efficient than using an 'int32' or 'integer' (4 Bytes).
I was using the 'Byte' declaration for integer variables that would never see a value higher than 255. I understand this to be slower than just using the 'integer' declaration. Right?
Thanks,
Karen
Nooobie to OOP and VB.Net 2005
|
|
|
|
|
watagal wrote:
I was using the 'Byte' declaration for integer variables that would never see a value higher than 255. I understand this to be slower than just using the 'integer' declaration. Right?
Not necessarily. Depends on what math your doing and what the result is going to end up in.
But, you also don't ahve to be THAT tight with it. The size of the variable isn't really a concern because of the VAST memories of today's systems. What makes a "tight" class is the use of proper OOP techniques, data types, logic, class organization and relationships to other classes. At least IMHO.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Greetings,
My hope is that someone can help a newbie trying to learn this OOP on her own.
My base class is POINT2 and the derived class is POINT3 and I'm trying to overide the subroutine called add.
As the code is written - I get the error sub "add" cannot be declared 'Overrides' because it does not overrides a sub in a base class and it recommends to me to remove the keyword Overrides.
Once I remove the keyword Overrides, I get the error message, sub 'add' shadows an overridable method in the base class 'POINT2'. To override the base method, this method must be declared 'Overrides'.
Now I'm not pointing the finger at Microsoft, I'm sure it is something I did or didn't do.
Help me stop chasing my tail.
Karen
Nooobie to OOP and VB.Net 2005 (beta)
' 2D POINT ===========================================================<br />
Public Class POINT2<br />
Friend _X As Decimal = Nothing<br />
Friend _Y As Decimal = Nothing<br />
<br />
Public Sub New(ByVal x As Decimal, ByVal y As Decimal)<br />
mybase.new()<br />
Me._X = x<br />
Me._Y = y<br />
End Sub ' Constructor<br />
<br />
Property X()<br />
Get<br />
Return (_X)<br />
End Get<br />
Set(ByVal value)<br />
_X = value<br />
End Set<br />
End Property ' Get/Set X<br />
<br />
Property Y()<br />
Get<br />
Return (_Y)<br />
End Get<br />
Set(ByVal value)<br />
_Y = value<br />
End Set<br />
End Property ' Get/Set Y<br />
<br />
Public Overridable Sub add(ByRef p1 As POINT2)<br />
Me._X += p1.X<br />
Me._Y += p1.Y<br />
End Sub<br />
<br />
End Class ' 2D POINT Class<br />
<br />
<br />
' 3D POINT ===========================================================<br />
Public Class POINT3<br />
Inherits POINT2<br />
<br />
Friend _Z As Decimal = Nothing<br />
<br />
Public Sub New(ByVal x As Decimal, ByVal y As Decimal, ByVal z As Decimal)<br />
MyBase.New(x, y)<br />
Me._X = x<br />
Me._Y = y<br />
Me._Z = z<br />
End Sub ' Constructor<br />
<br />
Property Z()<br />
Get<br />
Return (_Z)<br />
End Get<br />
Set(ByVal value)<br />
_Z = value<br />
End Set<br />
End Property ' Get/Set Z<br />
<br />
Public Overrides Sub add(ByRef p1 As POINT3)<br />
Me._X += p1.X<br />
Me._Y += p1.Y<br />
Me._Z += p1.Z<br />
End Sub<br />
End Class ' 3D Point
Thanks,
Karen
Nooobie to OOP and VB.Net 2005 (beta)
|
|
|
|
|
In your implementation, you're adding functionality to a base class, POINT2, not overriding it. The base class supports every associated with POINT2, including it's Add method. Your Add method takes a parameter of POINT2 pass ByRef. In your POINT3 class, your Add method is taking a parameter of POINT3 ByRef. This is a different method from the base class.
So what you're really doing is adding new support to the Add method in POINT2, not replacing it. This is called Overloading. You have multiple methods with the same name that take different parameters. Calling the Add method with a POINT2 parameter will call the POINT2 class' version. Calling the Add method with a POINT3 parameter will call the POINT3 subclass' Add method.
A few things need to be changed in your code. We'll start with POINT2:
' 2D POINT ===========================================================
Public Class POINT2
'Friend _X As Decimal = Nothing ' Remove the "= Nothing"'s. Decimals are value types that
'Friend _Y As Decimal = Nothing ' can't be set to Nothing. Also, you might want to change
' these to Doubles instead. Decimal types are 128-bit numbers
' and a rather slow to work with.
Friend _X As Double
Friend _Y As Double
Public Sub New(ByVal x As Double, ByVal y As Double)
'mybase.new() ' Since this class isn't inheriting from anything (well, not really true!),
' you're calling the New of System.Object, which doesn't
' do anything. Remove this line.
'Me._X = x ' You should be setting your initial values using your
'Me._Y = y ' Property statements. Your Properties can validate the data
' and return Exceptions if not valid.
Me.X = x
Me.Y = y
End Sub ' Constructor
Public Property X() As Double ' It doesn't hurt to be specific about what your coding.
Get ' Making assumptions and not specifying exactly what you
Return Me._X ' want Public/Private can lead to hard to find problems.
End Get
Set(ByVal value)
' You might want to do some checking of your values to see if they
' are valid before setting the value of this class instance.
Me._X = value
End Set
End Property ' Get/Set X
Public Property Y() As Double
Get
Return Me._Y
End Get
Set(ByVal value)
' You might want to do some checking of your values to see if they
' are valid before setting the value of this class instance.
Me._Y = value
End Set
End Property ' Get/Set Y
Public Sub add(ByRef p1 As POINT2) ' Remove the Overridable modifier. You won't need it
Me.X += p1.X ' since your not actually replacing the functionality
Me.Y += p1.Y ' of POINT2, just adding another version of 'Add" to it.
End Sub
End Class ' 2D POINT Class
Now on to POINT3:
' 3D POINT ===========================================================
Public Class POINT3
Inherits POINT2
Friend _Z As Double
Public Sub New(ByVal x As Decimal, ByVal y As Decimal, ByVal z As Decimal)
'MyBase.New(x, y) ' This line isn't required because you're setting all
' three values in this constructor. Anything you do in
' in the POINT2 constructor would just be overwritten
' by what you have in this one.
Me.X = x ' Again, go through the Properties!
Me.Y = y
Me.Z = z
End Sub ' Constructor
Public Property Z() As Double
Get
Return Me._Z
End Get
Set(ByVal value)
Me._Z = value
End Set
End Property ' Get/Set Z
Public Overloads Sub add(ByRef p1 As POINT3) 'Use Overloads here because you adding another
Me.X += p1.X ' version of 'Add' to the base class that takes a
Me.Y += p1.Y ' different parameter from what the base class version does.
Me.Z += p1.Z ' Also, do your math using the Property versions of the
' fields. You can check the values of the results of the
' math much easier this way.
End Sub
End Class ' 3D Point
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks so much for your quick response. Last week, I read the same thing in 2 different books - you made it much more clearer and practical.
Thanks,
Karen
Nooobie to OOP and VB.Net 2005
|
|
|
|
|
Dave Kreskowiak wrote:
Public Sub New(ByVal x As Decimal, ByVal y As Decimal, ByVal z As Decimal)
'MyBase.New(x, y) ' This line isn't required because you're setting all
' three values in this constructor. Anything you do in
' in the POINT2 constructor would just be overwritten
' by what you have in this one.
Me.X = x ' Again, go through the Properties!
Me.Y = y
Me.Z = z
End Sub ' Constructor
Dave,
As soon as I comment out the 'Mybase.New()' statement in POINT3 class, VS2005 complains that it should be there.
This is where my code stands (w/o VS complaints):
Public Sub New(ByVal x As Double, ByVal y As Double, ByVal z As Double)
MyBase.New(x, y)
Me.Z = z
End Sub ' Constructor
Is this ok?
Thanks,
Karen
Nooobie to OOP and VB.Net 2005
|
|
|
|
|
There's something you haven't shown in the POINT2.New constructor. This message shouldn't come up with the code that I've seen and what I posted. The code that I posted came straight out of VB.NET 2005 and it compiled nicely.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|