|
Thanks for the question. As I mentioned in my request, many of the webcontrols are third party, home-grown and .net. Since these change often (upgrades, etc), I do not want the object I am writing, to depend upon the specific references. This class will be used by an object whose sole responsibility is to use reflection to keep the webcontrol and the business objects in sync.
|
|
|
|
|
I've been looking at this, and thinking "what a pain in the ...".
You said you've seen C# implementation of this?? What's stopping you from adding it to your solution as another project and referencing it??
|
|
|
|
|
The first time I try to fill a big datatable with a DataTable.readXML("file") command, it's fast. The next time I try to fill the same datatable from the same file it's really really slow. Any idea why? This seems to happen even though I have completely cleared the datatable before the 2nd read.
Thanks
|
|
|
|
|
it might be that you still have a connection open to the xml file from the first read.
see if you can't close it after reading from it.
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
cstrader232 wrote: This seems to happen even though I have completely cleared the datatable before the 2nd read.
But did you destroy it and create another one??
|
|
|
|
|
OK, let's say I need to destroy and recreate. Can I do that to one datatable of a collection?
Public Shared ChartDataTable(5) As DataTable
or do I have to destroy and recreate the whole collection?
I figured that the datatable.readXML command would automatically close the connection for me. Is that not so?
Thanks!
|
|
|
|
|
cstrader232 wrote: Can I do that to one datatable of a collection?
Of course.
CharDataTable(3) = New DataTable(...)
|
|
|
|
|
I am writing a program using random access files. Is there a way with a Random Access File to do the following:
- Check to see if the file exists, if it does not exist then return an exception?
- What is the difference between opening a random access file and opening file with a stream reader object?
- Can I use a stream reader object to open a random access file?
If a stream reader object does not open a random access file what is the best type of file to use. When I created a stream reader object I got the blue line. What is the stream reader class? Is it already part of VB.Net?
I thought that I would use a random access file because they are faster than a sequential access file.
|
|
|
|
|
There is no such thing as a "random access file". All files can be read using random access. The data in the file might not be meaningful to access using random access, though. A text file for example has to be read as a stream, unless you read the entire file and then decode it into a string.
A StreamReader doesn't read from a file, it reads from a Stream, which in turn may read from a file. A StreamReader reads sequentially from the Stream, and simplifies reading text files for example.
AAGTHosting wrote: Check to see if the file exists
Use the File.Exists method.
AAGTHosting wrote: When I created a stream reader object I got the blue line. What is the stream reader class? Is it already part of VB.Net?
Yes, you find it in the System.IO namespace.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
I hope I am in the correct forum to ask this question about VB 2005. I want to include BLAT.EXE file in my Solution when I publish it for use on CDROM. I do not know where to add Blat.exe, Blat.dll and Blat.lib so that it will be copied when I publish my program. I can make a folder called C:\Blat and copy the files from there to the new C:\test directory. I can get it to publish the program and I can run setup.exe to install it but it will not find BLAT.EXE. Any help will be appreciated.
|
|
|
|
|
I would like to see what the answer for this is as well. The only thing I could think of would be to write an installer script for MSI or NSIS.
|
|
|
|
|
I can add Blat.exe to my path down in \bin\Debug\ folder and then have the program run in VB2005 IDE and it will work fine using the path in the source code. I can run it with the path of blat pointing to C:\BLAT\Blat.exe and it works fine but I just cannot figure out how to include the blat files in the compiled product. I remember in other programming IDEs where I could include these files in the compilation.
|
|
|
|
|
add a setup project to you're solution
in that project you can add:
-desktop shortcuts
-start menu shortcuts
-files for the application folder. this is the one you want here you can add files to you'r project's exe, make shure you add the output from you're startupproject otherwise it will not run.
These file's whill then be placed to the folder that you'r prog is installed on
also possible:
-setting name that will apeare in software manager
-setting conditions for the setup (.net framework has to be presend is default)
-....
after you are satisfied with the setup of the setup project, build it and you will find a exe and a msi in the debug/release map of this project.
the exe will first check if the .net framework is present and then start the msi wich holds you'r programme and the files you added
look around a bit it has many posability's
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
I am unsure the best way to cancel my background worker (bgw).
My application (form1) has an options screen (form2). On app load, a background worker starts to ping a list of IPs. I would like to go into my options form and tell my app a different list of IPs to ping. Once I make this change, i need to stop the current bgw from pinging, reload the list, and start pinging again.
I know that I first have to set the WorkerSupportsCancelation property to true, which should set CancellationPending to true, then call the CancelAsync method, check the CancellationPending, then cancel it as this article suggests.
My issue is that I am canceling the bgw from the second form and do not currently have a 'DoWorkEventArgs' object to cancel.
What am I missing to get this object and cancel the bgw?
Thanks!
|
|
|
|
|
Once a thread is started and stopped, it cannot be restarted. You're best bet is to cancel the existing operation, and let the thread die. Create a NEW background worker, just the way you already, did and supply it with the new list.
|
|
|
|
|
Hi All
I am trying to connect to my database from the front end in VB.NET 2003, the connection strings that i have tried are not working at present. I have VB.NET 2003 program from last year but that was using access as the back end and VB.NET 2003 as the front end. This year i must use oracle as the back end and Vb.Net 2003 as the front end. The connection strings that i have tried do not seem to be correct but i will keep trying it is probably something simple. Yes the database does connect through odbc and the tns file is correct
|
|
|
|
|
WIthout seeing any code for the connection string, or an error descriptions, about all anyone can do is point you at ConnectionStrings.com[^].
|
|
|
|
|
the code is
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim ctoracleConnection As OleDbConnection<br />
Dim ctoracleCommand As OleDbCommand<br />
Dim dataRow As OleDbDataReader<br />
'MSDORA is the provider when working with Oracle<br />
ctoracleConnection = New OleDbConnection("Provider=MSDAORA.1;User ID=oracle username;password=orac le password; data source=ctoracle")<br />
'opens the connection<br />
ctoracleConnection.Open()<br />
'executes the command and assigns it to the connection<br />
ctoracleCommand = New OleDbCommand("Select EName from emp", ctoracleConnection)<br />
dataRow = ctoracleCommand.ExecuteReader()<br />
While dataRow.Read()<br />
'displays data from the table<br />
MessageBox.Show("Employee Name" & " " & dataRow(0))<br />
End While<br />
dataRow.Close()<br />
ctoracleConnection.Close()<br />
End Sub<br />
End Class<br />
_______________________________________________________________________________________________________________________________
|
|
|
|
|
And the exception message??
|
|
|
|
|
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim derbyConnection As OleDbConnection<br />
Dim derbyCommand As OleDbCommand<br />
Dim dataRow As OleDbDataReader<br />
'MSDORA is the provider when working with Oracle<br />
derbyConnection = New OleDbConnection("Provider=MSDAORA.1;User ID=oracle ken;password=tigger; data source=derby.com")<br />
'opens the connection<br />
derbyConnection.Open() '''''the code falls over here<br />
'executes the command and assigns it to the connection<br />
derbyCommand = New OleDbCommand("Select EName from emp", derbyConnection)<br />
dataRow = derbyCommand.ExecuteReader()<br />
While dataRow.Read()<br />
'displays data from the table<br />
MessageBox.Show("Employee Name" & " " & dataRow(0))<br />
End While<br />
dataRow.Close()<br />
derbyConnection.Close()<br />
End Sub<br />
dave thanks for your help beforehand
|
|
|
|
|
The Provider in the connection string should be just "MSDAORA", drop the ".1" part. I also don't know if putting a period in the database name is legal, nor do I know if putting a space in the User Id, "oracle ken", is legal either.
OleDb is a kind of "generic" database interface. Like the other poster said, you'd get much better performance if you used the OPD.Net provider instead. This will, of course, require a rewrite of your code.
|
|
|
|
|
when opening server explorer should the oracle database not be displayed there for me to point to and then test. As the database is not showing there.
I tried database connection with my access and it connected successfully but will not connect to the oracle database but it is not displayed in the server explorer.
|
|
|
|
|
kendo17 wrote: when opening server explorer should the oracle database not be displayed there for me to point to and then test. As the database is not showing there.
The provider and credentials have to be correct in order for it to connect to the server and get the list of databases. The credentials also have to have permissions in the Oracle server to get that list. I don't know exactly what has to happen on the Oracle server, since I've never used Oracle, nor do I want to.
|
|
|
|
|
Oracle & SQL Server Databases are server-based database. They are not Filedatabase like Microsoft Access. So they cannot be open like you open ur access db file. The Oracle Database like SQL Server has an Enterprise Console where you can manage the database
t.aransiola
|
|
|
|
|
And you're telling me this why??? I know that, and your answer has nothing to do with the problem.
|
|
|
|