|
Posting C# code in the VB.NET Forum?! Shame on you!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
D'oh! I switch so frequently between the 2 forums, that sometimes I forget where I am.
|
|
|
|
|
I do the same thing. I've spent sooo much time around here, it's impossible to keep everything straight. At least it's not as bad to post foreign code here as it is to post VB code in any of the "C" forums. Try posting VBScript code in the C++ forum, then run for cover!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Jamie is essentially correct, but supplied the code in the wrong language.
You can ReDim Preserve an array to the new size you want, but this is very inefficient.
Dim ub As Integer = UBound(myStrings, 1) + 1
ReDim Preserve myStrings( ub )
myStrings(ub) = "something"
2) You can use a list such as ArrayList which will dynamically expand
Dim list As New ArrayList
list.Add("String1")
list.Add("String2")
this can still be converted to a string array when needed
Dim strArray As String() = list.ToArray(GetType(String))
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I want to know that what is replacement of the INI files
Actually i have to save some settings like open connection, forms colorings etc
in the settings files
So what type of file i have to use in Vb2005
XML / Config/Settings what r they????
Thanks in advance
Regards
Hema Chaudhry
|
|
|
|
|
the app.config file is just an XML file. You can actually do some fairly funky stuff with .NET 2.0 with regard to config files. The basics are that you have:
<appSettings>
<add key="mySetting" value="someValue" />
</appSettings>
Which you can read with the ConfigurationSettings class in the System.Configuration namespace
ConfigurationSettings.AppSettings["mySetting"];
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
-- modified at 8:56 Wednesday 18th January, 2006
|
|
|
|
|
Thanks for the prompt & precise answer.
I have to perform both read as well as write operation also
AS i have to write some settings
as well as read some settings
Then what is the baest approach
To create a simple XML file
& perform Reda write operation
Or something else is the better approach
Thanks for this kind support
Hema Chaudhry
|
|
|
|
|
The System.Configuration[^] has a number of classes that help you do this. As you are using .NET 2.0, if you look at the documentation for ConfigurationManager[^] it will show some example code that that will help (also, the examples for the related classes)
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Thanks for this Useful direction
I ahve seen the Configuration Manger Class
I think It will fit to my requirement
Thanks a lot To give this Link
I more thing I want to ask
That is there is any thing new feature In 2.0 or Visual Studio 2005
To have the Multi COlumn Combo Box in the DatagridView
Or if there is any other way to do that
If make a custome control
then how to add etc.
So plz give me the direction for this also
AS i m stuck with this problem since last 3 months
Thanks a lot again.
Thanks & Regards
Hema Chaudhry
|
|
|
|
|
HemaRawat wrote: I more thing I want to ask
That is there is any thing new feature In 2.0 or Visual Studio 2005
To have the Multi COlumn Combo Box in the DatagridView
Or if there is any other way to do that
Don't know. Also, this is a new question on a different topic - you should start a new thread.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Hello,
Due to some minor misdemeanour in a previous life I have been tasked with reviewing a simple VB .NET application. The problem is I have never written a line a VB code.
I need to check an object variable for null state, something along the lines of this:
Dim cn As Data.SqlClient.SqlConnection
....
....
If cn != null Then
If (cn.State = ConnectionState.Open) Then
cn.Close()
End If
End If
Basically I need to ensure that cn has been instantiated before checking its state, so the question is how do I perform the "cn != null" check highlighted in the code snippet above.
|
|
|
|
|
For some reason, null is called Nothing in VB. There is another quirk, also. You can not compare a reference to Nothing, you have to use the is operator:
if not cn is Nothing Then
---
b { font-weight: normal; }
|
|
|
|
|
Hi VB community,
I am writing a new project "X2" in VB.Net (Visual Studio 2005). I have the "xyz.dll" ( several functions ) in Windows folder. I have the source code in project "X1" in VB6. I tried to declare and to use the "xyz.dll" in VB.Net in the same way as in VB6. No way. Converting is useless to me because I just start to learn VB.Net. Maybe someone know how to write ( in general ) the delaration part and the implementation part for the *.dll functions.
Thanks for any sugesstions.
sbststtswbwgf
|
|
|
|
|
It's just about the same way as done in VB6, the major differences being that some datatypes mean different thing in VB.NET than they do in VB6. An example of which is a Long in VB6 is a 32-bit signed integer, while a Long in VB.NET is a 64-bit signed integer. They're not interchangable!
What does both your VB6 and VB.NET declaration code look like?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
Thanks for the advice. Now the VB.Net code start to fly.
sbststtswbwgf
|
|
|
|
|
Helloooooooo Everybody......
I need to add a Column to my Access DB during runtime.Using the Columns.Add Function Column gets added to the Dataset but is not updated in actual database after using Adptr.Update Function.I m using Disconnected Architecture of ADO.NET.Is the Update function just to Add or update the 'Rows' of DB & not for 'Columns'? If this is true then pls tell me how to add a new column in DB.
Your Reply is as important as Sachin Tendulkar to the Indian Cricket Team.......
Thnx a lot !!!!!!!!
|
|
|
|
|
Use the alter table command in an sql query to add a field to the table.
Altering the database design in runtime is almost always an evidence of poor database design, though.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa,Thnx for ur reply ..............
|
|
|
|
|
Hi all,
Can any one plz tell me is there any method to call or use data reports in VB.Net or ASP.Net
Plz help me.
Awaiting for ur kind feedbacks
Live Life King Size
Asif
|
|
|
|
|
What do you mean by "data reports"? Where is this report comming from? Crystal Reports? Microsoft Operations Manager? An old VB6 DataReport control?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi RageInTheMachine9532,
I mean VB6 DataReports,I want them to have in VB.Net can u help me.Plz....
Live Life King Size
Asif
|
|
|
|
|
aseef wrote: VB6 DataReports
What on earth for????
The DatReport is part of the VB6 RunTime and not available to VB.NET. Its basic functionality is in the DataGrid in VB.NET. For a more advanced version, look into using Crystal Reports.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
See I dont have any intrest for getting datareports in vb.net but my sh*t client wants the sh*t of data reports in his application.
Plz help me if u can
Live Life King Size
Asif
|
|
|
|
|
Sorry, but it's a designer for VB6. It doesn't work in VB.NET.
If your client wants that specific functionality, you'll have to write your app in VB6.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello, currently i'm import a database from microsoft access. Let say the file is BIBLIO.MDB.The data has 5 column with 156 row. I can display sort of datas in the listview. But, the problem here is how can i choose a row and display the data's in five different textbox(remember i have 5 column which is 5 fields of data) just by double click at the firs row (letsay the product ID or the row ID..e.g 1,2,3,4...156). I want to display it in the different textbox so i can use it to calculate some other mathematic problem. Furthermore by choosing using "double click" method it's more convinient for user to choose which row of data that they want.
Hopefully to hear from you soon.
Thank You
Thank, very much.
|
|
|
|