|
"OleDbConnect and SqlConnect aren't part of the .NET Base Class Library or ADO.NET. Where did these come from?"
They are controls available to me it VS.NET when I am designing ASP.NET or VB.NET apps, and used in the tutorials and samples I'm reading in these ASP.NET and VB.NET books and at MSDN.
I'm sure if I read the books and MSDN website page by page, it will explain the difference. I guess I can't just presume that prior VB and ASP knowledge would have saved me from this confusion.
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
OleDbConnection and SqlConnection are objects, but not OleDbConnect or SqlConnect.
I never use the database controls in the ToolBox. I always code my database stuff by hand. It gives greater control and you don't have to worry about code being generated that you can't see without going into the "Windows Form Designed generated code" region. Do it by hand and everything is in one place.
ADO.NET is strickley for database access. ASP.NET is a server-side HTML generation technology.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Forgive me if this is turning into a .NET tutorial, but it is very helpful to me...
So, does that mean all your code is on the .ASP page, not in the codebehind page? Is there *anything* on the codebehind page?
I confess I am confused about the relationship between the ASP page and the codebehind page in terms of what exists on each. I tried mapping one to the other, but some parts are there and some aren't. Is it possible to code ASP.NET pages without any need for a codebehind page?
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
Everything VB.NET is in the codebehind file. Everything HTML is in the .apsx file.
The VB.NET code controls what happens when you use the controls on the HTML page. It's very similar to what's going on in Windows Forms. You see the Designer that lets you place the controls on a form and the "codebehind" that lets you attach code to the control's events, like "click".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I see Visual Basic code in aspx pages in the examples. Is this not generated from the code window?
Also, when I write Visual Basic in the code window, it creates HTML/ASP/VB in the HTML page.
Are you saying that if I write everything in the HTML page, there will be nothing (or at least, nothing of consequence) in the codebehind file?
I guess I should try this so I understand it better, it just seems like I'm throwing away many of the features of Visual Studio.
Is it possible that the relationship between Visual Studio and html pages is equivalent to something like FrontPage and html pages? i.e. Frontpage is easier for designers, but it blows as far as writing clean code. I never use WYSYWIG HTML editors - I always use Homesite (which doesn't mangle code).
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
DaveC426913 wrote:
Is it possible that MSDN doesn't bother to clarify the language context of its instructions?
No, it tells you at the top, when it tells you the namespace of the control you're reading about.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am trying to search through a dataset using a
while League.Tables(0).Columns(0).Table.Rows(count2).Item(0) <> Winner
end while
Winner is a string, as is whatever may be contained in the datatable. So how do I get it to execute the while loop until the text in the table "Does not equal" the text in the Winner string?
|
|
|
|
|
daviiie wrote:
while League.Tables(0).Columns(0).Table.Rows(count2).Item(0) <> Winner
end while
Are you incrementing count2 in that While loop?
Do While League.Tables(0).Columns(0).Table.Rows(count2).Item(0) <> Winner
.
.
count2 = count2 + 1
Loop
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
daviiie wrote:
while League.Tables(0).Columns(0).Table.Rows(count2).Item(0) <> Winner
end while
Winner is a string, as is whatever may be contained in the datatable. So how do I get it to execute the while loop until the text in the table "Does not equal" the text in the Winner string?
If you want to execute UNTIL Winned DOES NOT equal the text, you want to execute WHILE it DOES equal the text. So...
while League.Tables(0).Columns(0).Table.Rows(count2).Item(0) = Winner
Roy.
|
|
|
|
|
I keep getting the following error message in my vb.net code:
"Format of the initialization string does not conform to specification starting at index 0."
I get the message when I refer to a class from a web form, when this code runs:
oPolicy = New Policy
oDR = oPolicy.GetPolicy()
I am calling the function GetPolicy in the Class Policy.
Anyone nay ideas.
macca
|
|
|
|
|
Policy is a namespace in the .NET Framework, not a class. .GetPolicy is also, not a method of any class in the .NET Framework.
You'll have to copy and paste the code snippet here. You haven't provided enough information to help with your problem. What is the Policy class?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have 4 text boxes
Textbox1, Textbox2, Textbox3, textbox4
Textbox4 is readonly and you can enter values in textbox1,2 and 3
What do I have to do so that when a value is entered into textbox1,2 or 3 it is automatically updated in textbox4
|
|
|
|
|
Handle the TextChanged event of all three textboxes. Convert the text in each TextBox to a number and add them together, putting the result in TextBox4. Something like this:
Private Sub ValueEntered(...) Handles TextBox1.TextChanged, TextBox2.TextChanged, TextBox1.TextChanged
Dim Value1, Value2, Value3 As Double
Value1 = Double.Parse(TextBox1.Text)
Value2 = Double.Parse(TextBox2.Text)
Value3 = Double.Parse(TextBox3.Text)
TextBox4.Text = (Value1 + Value2 + Value3).ToString()
End Sub
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello
Can anybody tell me of any OCX's or some other stuff that I can use in vb6 to convert a series of (pair of) jpg and wav files into an avi file. Please, if u mention of some thing , make it sure that it is not a shareware version.
Thanx
|
|
|
|
|
What's better to create a compact and reusable code: an OCX or a Dll ?
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
That depends on what environment it's going to be used in.
If your using it exclusively in .NET Framework apps, then a straight .DLL would be better.
If your code is going to be used by COM-based clients, like VB6 or Internet Explorer, then an OCX implementation would probably be better.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
That depends on what environment it's going to be used in.
Yes, that's the item. I'm planning in a near future to migrate several OCX made with VB6 and used in VB6 applications to .Net platform. There's no Internet apps involved but, from my point of view, the advantage of making them in OCX is that they are encapsulated and the look and feel is with the component itself and in a Dll, this l&f, could be implmented, but it's not so obvious and visible under design stage.
The apps where this components will be injected will be also migrated to .Net (I already don't know if it'll be VB, VC++ or C#).
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
-- modified at 9:10 Wednesday 7th September, 2005
|
|
|
|
|
When using an .OCX (COM component) in the .NET Managed world, you're not actually getting a completely self contained component. To use the COM component, you have to have Interop .DLL's as a bridge between the managed and unmanaged worlds. These will show up in your .EXE's Release or Debug folders as AxInterop.*.dll and Interop.*.dll. Theses .DLL's MUST ship with the .EXE, so you're not really getting a completely self contained component.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
So, if I want to make a full self contained component what is the alternative?
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Again, that depends on the environment you're targeting. If it's going to be used soley in a .NET environment, then a standard control project (targets to a .DLL) will work.
If you're targeting other environments, like VB6, then an OCX would work better. If you target a COM based environment, you just can't get around the registering issues without sacrificing some of the environments your component can support.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Great thanks !! I'll keep all this information in mind when choosing the platform.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
The main question you need to answer is "Does the component need to be hosted in a container (i.e a form, webpage) that the component needs to be aware of?" If the answer is yes, the component needs to be an OCX. If the answer is no, you should use a DLL because the performance is better than an OCX.
The Common Dialogs in VB6 are a good example of components that really do not need to be hosted as an OCX. Although VB6 gave you an OCX for Common Dialogs, many developers also rolled their own DLLs to provide the same functionality. The reason was the OCX was an unneccessary performance hit - Common Dialogs did not need any of the typical container notifications - resize, repaint etc. a modal dialog could be shown just as easily from a DLL as an OCX, so the OCX was an unneccessary additional layer.
On the other hand, a control that needs to paint, refresh otherwise process it's own graphical interface in response to things like form resizing should probably be packaged as an OCX.
As far as NET goes, you will require a Primary Interop component for ANY COM component, not just an OCX. So that is not a relevant factor to making a decsion of which to use.
If the component does not have a graphical interface at all, or has a graphical interace that consists of only showing modal dialogs, you in alll liklihood should be using a DLL.
|
|
|
|
|
The component will need a graphical interface (picture, labels, leds) amd not a dialog, it'll have to be embeded in a dialog so I think it has to be an OCX but I'd like to avoid the installation, registering problems of these components. Is there any other alternative?
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
I have a ActiveX control developed in vb6 and a DLL also developed in vb6. By means of vb.net I create an instance of the DLL and by means of the InvokeMember method I want to call to a method that this in the ActiveX control happening to him through parameter the instance of the DLL but gives TargetInvocationException error me.
--------DLL classVB.class1---------
Private texto As String
Public Sub setTexto(t As String)
texto = t
End Sub
Public Function getTexto()
getTexto = texto
End Function
--------Vb6 ActiveX control-----------
Public Sub setCerebrino(ByRef cVari As classVB.class1)
c = cVari
MsgBox "setCerebrino"
End Sub
------ VB.NET method-----------------
Private Sub InitializeComponent(ByVal strProgId As String, ByRef objParamAs classVB.class1)
Dim resources As ResourceManager = New ResourceManager(GetType(AxForm))
Dim type As Type = type.GetTypeFromProgID(strProgId, True)
m_axCtrl = New AxControl(type.GUID.ToString())
CType((m_axCtrl), System.ComponentModel.ISupportInitialize).BeginInit()
SuspendLayout()
m_axCtrl.Enabled = True
m_axCtrl.Name = "axCtrl"
m_axCtrl.TabIndex = 0
Controls.Add(m_axCtrl)
Name = "AxForm"
CType((m_axCtrl), System.ComponentModel.ISupportInitialize).EndInit()
ResumeLayout(False)
OnResize()
Dim obj As Object
obj = m_axCtrl.GetOcx()
Dim m As ParameterModifier = New ParameterModifier(1)
m(0) = True
Dim mods() As ParameterModifier = New ParameterModifier(1) {}
mods(0) = m
type.InvokeMember("setCerebrino", BindingFlags.InvokeMethod, Nothing, obj, New Object() {objParam}, mods, Nothing, Nothing)
End Sub
Thanks in advance.
Hugo
|
|
|
|
|
I have 3 variables A,B,C. If the value of A is X then the values of B and C should be Null. If the value of B is X then the values of A and C should be Null and If the value of C is X then the values of A and B should be Null. Either the value of A,B or C can be X at a time.IF not it should give an error. How to implement a logic for this without an If statement? I need a simple logic for this. I dont want multiple IF statements like
if (A==x) then
{ B==0 && C==0 }
else if (B==x) then
{ A==0 && C==0}
else if (C==x) then
{ A==0 && B==0}
else
printf("error");
|
|
|
|