|
fileContents is a String, so you would want the documentation on all the methods that a String has. Here[^] on MSDN.
As for your split statement, try:
Dim contentArray() As String = fineContents.Split(Environment.NewLine)
or
Dim contentArray() As String = fineContents.Split(ControlChars.Cr)
or
Dim contentArray() As String = fineContents.Split(ControlChars.Lf)
... depending on your text file format.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That's great! I always forget about MSDN.
Thanks again Dave.
|
|
|
|
|
I'm in the process of migrating an app from VB6 to VB.NET. I'm not at a point where I'm trying to pull data from an Informix database using ODBC and datareaders. The problem I'm having is that it's only coming back with one row. When I execute the exact same SQL statement on the server, I get 127 rows.
Here's what I've got:
================================================================================================
GetAccounts = New Collection
rs = RunSQLReturnRS(sqlReader, "select unique name from edipro_send_recv where name not matches '997*'")
Do While rs.HasRows()
GetAccounts.Add(CType(rs.Item(0), String))
rs.NextResult()
Loop
================================================================================================
Public Function RunSQLReturnRS(ByRef sqlReader As OdbcDataReader, ByRef strSP As String, ByVal ParamArray params() As Object) As OdbcDataReader
Dim cmdSql As OdbcCommand
Try
cmdSql = New OdbcCommand(strSP, DbConnection)
cmdSql.CommandType = CommandType.Text
RunSQLReturnRS = cmdSql.ExecuteReader(CommandBehavior.Default)
Catch ex As Exception
MsgBox("An exception has been thrown in the the Database.RunSQLReturnRS function." * NewLine() & ex.Message, MsgBoxStyle.OKOnly, "Error: Exception Thrown")
End Try
End Function
===============================================================================================
I would greatly appreciate any assistance with this. For the life of me I can't figure out what to do next. BTW... the connection is opened and closed in different Sub's under the identity of DbConnection.
--In a world without fences, who needs Gates?
|
|
|
|
|
|
SignMan359 wrote:
CType(rs.Item(0), String))
This code will only return the first row of the result set. You might want to iterate through the result set to get at the other rows. Try setting a breakpoint on this line and look at the rs object in the debugger to see that it really does contain more than one row.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am trying to use the Code Access Security Policy Tool (Caspol.exe) to set my .net console app permissions. When the following is run from command line:caspol -machine -addfulltrust C:\Program Files\Utility.dll
I get this error:
Microsoft (R) .NET Framework CasPol 1.1.4322.573<br />
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.<br />
ERROR: Unable to load assembly<br />
Usage: caspol <option> <args> ...<br />
caspol -af<br />
caspol -addfulltrust <assembly_name><br />
Add full trust assembly to policy level<br />
What needs to be done to resolve this error? Second question is there a better way of scripting the setting of trusted assemblies? Thanks,
Jason W.
|
|
|
|
|
Why does that path you specified look like it's bad?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You might also want to put the full path to the assembly in quotes so it's not parsed up as two seperate arguments:
caspol -machine -addfulltrust "C:\Program Files\Utility.dll"
Are you sure this is the correct path?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello coders,
I have been designing an application which contains a class called table.
There is a property called RelatedTables whose type is also a collection of tables ( I have created an extra class called TableList which extended from the ArrayList class )
In runtime, I do assign the selectedobject property of a propertygrid to a new instance of the table class, like below
dim p as new Table
PropertyGrid1.SelectedObject = p
As we all guess, the property grid will be filled with the properties of the class. As I mentioned there is a property called RelatedTables which is a collection of the Tables. I would like to add items(tables) which have been created before (in run time), to collection (RelatedTables)
How can I do that?
Thank you.
Best Regards
Emre YAZICI
|
|
|
|
|
Same as the title says, by the way, is using things in a macro button any different from doing it in an actual app, or a compiler?
|
|
|
|
|
It's a little bit different, but all the concepts are the same.
Shell "command line goes here"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello! Does anyone know if an ActiveX component can be given the ability to uninstall itself? And how would you go about doing so? There does not seem to be much information on this topic on the NET... Plan B would involve having the ActiveX create a desktop shortcut, which would be used to remove the activeX component after the browser has been closed. Has anyone tried to do anything similar?
Thanks for any and all suggestions.
|
|
|
|
|
They all have the ability to un-register themselves, but not delete themselves. You can't delete a file in code in the file is running.
You can write a small batch file to unregister the control and then delete it if you want.
regsvr32 -u <full path to control>
del <full path to control>
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the quick response. You have confirmed my view of the problem - and how to go about solving it:
1 - Let the ActiveX un-register itself (does this work correctly? Will this remove ALL registry entries related to the ActiveX? Does this require an actual function call, or does it happen automatically on component disposal? Just wondering...)
2 - Use a desktop shortcut to delete the ActiveX DLL from "Downloaded Program Files" directory. (I'm a little hazy as to what actually happens here - is this a true directory or more of a virtual one? Is the Dll actually located somewhere under the user's Documents and Settings?)
Anyway, thanks again for pointing me in the right direction.
|
|
|
|
|
Wait a minute... This is an ActiveX component in a web page? You'll have to supply a complete .CAB installation for the component, including the stuff to uninstall it. It cannot delete itself.
1 - The ActiveX control does NOT unregister itself unless your kick off the unregister code yourself. This can be done in code by calling the .DLL's DllUnregisterServer function or by using the RegSvr32 utility to call it. You still need an external program or batch file to delete the file.
2 - Yes, it's a true directory, under C:\Windows.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yes, the ActiveX is being used in a web page. The challenge at hand involves removing it from the client's computer after use.
The ActiveX is in a CAB. It doesn't yet include an unregisterDLL function, so I'm going to have to add that. While I'm at it, I'll also add a function to create a "delete ActiveX" shortcut on the client's desktop. (We can do this on the client computer because the ActiveX is a "trusted" one, with full access to the client machine.) Then the ActiveX will have to be repackaged in a new CAB, complete with digital signature.
Anyway, thanks for clearing things up for me.
|
|
|
|
|
Hello,
Last time i had posted a query & now i'm answering it. We dont need to specify smtp server name if our Outlook is already configured. But i am getting a problem. How should we access the email id of perticular person from database & send mail only to that email id with which our query matches,
Example : "Select emailid from emptable where empid = '1' "
The below code is running fine when i give fixed address for m.To=manoj.jahagirdhar@hp.com
But i'm unable to access email id from database. Kindly help me!!
Below is the code which is working fine for fixed email id
Dim m As New MailMessage
m.To = "manoj.jahagirdhar@hp.com"
m.From = "manoj.jahagirdhar@hp.com"
m.Subject = "Congrats!!Your Account Is Created. Collect Password from your mail"
m.BodyFormat = MailFormat.Html
m.Priority = MailPriority.High
m.Body = "Your Login ID is '" & TextBox1.Text & "' & Your Account Password Is '" & Password & "'"
SmtpMail.Send(m)
|
|
|
|
|
Question is not that clear. From what i understood, i think query is returning the email id, and giving that email id to the m.To should send the email. If it is giving error, can u tell me what is the error it is showing?
Het Waghela
Be Humble in Victory and Strong in Defeat.
Het Waghela, Blog|Het Waghela DotNet Questions Link|More Links
|
|
|
|
|
Im doing accounting financial report and it involves vertical arrangement of the report design.
let say i put this in my page header section as title:
[Assets]
Then i need to get all assets name from database and for this i use group section to display it ( is it page header cant do this? auto added if there is more record).
Then i want to put the next title
[Expenses]
I need to put that expenses title as like in page header but the position of this expenses must below after asset title and the collection of assets.
Then expenses collection have many different types of expense and i want to display this into group section again and the position of this sure after expense title.
I can do this if i can 'add' page header after the group section OR after report footer but crystal report cannot do that.
How can i solve this?
|
|
|
|
|
Is it possible to populate a datagrid with an array and if so how is it done.
How can you add a new line to a Dataset that is used to populate a grid. i.e. inputted text field to be added to the datagrid without saving it to the database. The reason you want to view the details and if not happy then do not save input values
|
|
|
|
|
I remember in VB6 there are this boxes called Masked Boxes. Is this 'Masked Boxes' still available to use in vb.net? If so, where is it, I can't find it..
|
|
|
|
|
Its not available in dotnet. you need to manually add it as a com control
Jon
|
|
|
|
|
Thanz for replying me on this... Manually add it in COM control huh? Can u tell me how to add it in.. ?
|
|
|
|
|
|
Hmm, i couldn't get in www.codeproject.com/dotnet/activexnet.asp. Is this the correct link?
|
|
|
|