|
Hey I'd uses a streamreader. so store your csv file in a variable and read it in a using statement using streamreader and set your array = reader.split(',') or ('/t') depending on what format your csv file is in.
|
|
|
|
|
Thanks for the feedback.
George
|
|
|
|
|
Hi,
Thanks for taking the time to read my post. I have spent lots of time reading other threads on here and everywhere else I could find and could not find a solution to my issue.
What I am trying to accomplish is to have two way communication between a service and a (single - for now) windows gui interface. I have found some basic examples on the web on how to pass a string to the server and playing around with it I was able to pass a Serializable class to the server and using functions get a class back from the server.
What I don't understand and can't figure out is how to get the server (service) to send an update to a client without the client requesting it, like an event. I found a server/client chat program that this works on but it is too complicated for me to follow and figure out how to do it.
Using the below example I changed the server into a Windows Form Application and then in the CommunicationService class I created a reference to the server form and called a public sub I had defined on it to bring the passed string into it. Although that works it is ugly and I am sure it is not the correct way to do it. How would I make more like a typical even driven system?
Below is an example I found on the net and I started with this to try and figure out how to accomplish my goals. What do I need to change or add to make this work the way I want it to?
Client:
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Ipc
Public Class Form1
Private Sub cmdSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSend.Click
Dim ipcCh As New IpcChannel("myClient")
ChannelServices.RegisterChannel(ipcCh, False)
Dim obj As SharedInterfaces.ICommunicationService = _
DirectCast(Activator.GetObject(GetType(SharedInterfaces.ICommunicationService), _
"ipc://IPChannelName/SreeniRemoteObj"), SharedInterfaces.ICommunicationService)
obj.SaySomething(txtText.Text)
ChannelServices.UnregisterChannel(ipcCh)
End Sub
End Class
Server - CommunicationService Class:
Public Class CommunicationService
Inherits MarshalByRefObject
Implements SharedInterfaces.ICommunicationService
Public Sub SaySomething(ByVal text As String) Implements SharedInterfaces.ICommunicationService.SaySomething
Console.WriteLine("The client said : " & text)
End Sub
End Class
Server - Main:
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Ipc
Module Main
Sub Main()
Dim ipcCh As IpcChannel
ipcCh = New IpcChannel("IPChannelName")
ChannelServices.RegisterChannel(ipcCh, False)
RemotingConfiguration.RegisterWellKnownServiceType( _
GetType(CommunicationService), "SreeniRemoteObj", _
WellKnownObjectMode.Singleton)
Console.WriteLine("Press ENTER to quit")
Console.ReadLine()
End Sub
End Module
SharedInterface:
Public Interface ICommunicationService
Sub SaySomething(ByVal text As String)
End Interface
Thanks for your time
Seamus
VB.Net 2005
|
|
|
|
|
Keep the server reference as a member variable in your Form1, instantiate it e.g. in Form_Load or the constructor.
To get a return value from the server, use a method with a return value, e.g.
Public Interface ICommunicationService
Function DoSomething(ByVal text As String) as String
End Interface
|
|
|
|
|
Thanks for the reply. I had thought that there must be a way to use remoting like a typical class, define it withevents and then easily pick up events on either side.
After reading some more I decided to use WCF. The duplex part I got working but once again I am struggling with bringing the events (callbacks) into the client form (I have created a reference in the callback class to the client form) but it seems kludgey to me.
VB.Net 2005
|
|
|
|
|
Hello Friends,
I would like to prepare simple crystal report and want to display in vb6 form. Here is the work I have done:
1 Crystal Report Created using Crystal Report 8.5
2 Designed Crystal Report and connect with Oracle 9i
3 Create standard exe project in vb6
4 Added Report which I have created.
5 While running i am getting following error.
Server has not yet been opened.
What is the solution to this, Please help me
Thanks in Advance.
Adarsh Patel
|
|
|
|
|
Using ODBC? Did you create a DSN? Can you connect and execute a select-statement using VB6 on the datasource?
Bastard Programmer from Hell
|
|
|
|
|
When I try to execute/view report same as i have attached it, it works fully...
But when i try to pass parameter / set my own data set it gives me error.
|
|
|
|
|
That's not enough information. What's the difference between "view report" and "view report with parameter/set your own dataset"?
Do you get an exception on any custom query that you execute? Can you try the report with the query "SELECT 1"?
Bastard Programmer from Hell
|
|
|
|
|
Thanks for your reply,
Now my report is working well...
Thanks once again.
Adarsh Patel
|
|
|
|
|
Hi,
Due to issues with VB6 on Windows 2008 I had created a C# EXE that wraps calls to VB6 COM DLL.
This works fine as long as I don't access the SQL database from the C#.
If I have a query from the SQL database in the C#, then in the VB DLL I have an exception when it tries to connect to the database ("Login failed for user...")
The system I am testing this on is windows 2008 32Bit and the SQL is SQL Server 2005.
Any ideas to the causes/how to solve the issue?
thanks.
|
|
|
|
|
Hi everybody,
this might seem very basic, but still I couldn't find a solution - maybe you have it...
Getting an Excel Range obviously results in a 2-dimensional array of object, even if it's only one column. The resulting array is supposed to be used for filtering a database using a LinqToSQL-Query ("...WHERE array.contains(listvalue)". This, unfortunately, seems to mandatorily need a 1-dimensional array.
Does anyone of you know a way out of this dilemma? I couldn't find any way of extracting one dimension into a separate array except iterating through it item by item.
Thank you
Mick
|
|
|
|
|
The only way I know of is iterating through the items, one by one, and creating a second 1-dimensional array.
|
|
|
|
|
Still thank you, Dave, for your answer.
|
|
|
|
|
Hello everyone,
I'm programming a web browser and I don't like it that my web browser actually runs from Internet Explorer instead of my application itself, is it possible for my web browser to have it's own proxy, "internet disconnected" page, I.p., etc. (like Google Chrome, Mozilla Firefox and Opera) I've had heard of Win Sock before, but I do not have extensive knowledge on that subject, but Am willing to learn anything you tell me (including Win Sock).
Simple Thanks and Regards,
Brandon T. H.
Been programming in Visual Basic for 4 years this point forward, and is very good at it (I can even create programs completely on code, without dragging those items from the toolbox). Programming C++ for 1 year so far and the same with C#.
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
You have to jump through some flamming hoops to get this to work. You can see an example of it here[^].
Basically, the Web Browser control is a managed wrapper for whatever version of IE is install on your machine. Since you're running IE in a window, it'll use all the settings you set in IE, unless you smash the Web Browser control with a large hammer.
|
|
|
|
|
|
|
OK thanks, but also I'm interested does exists some 3rd party program which will allow me to debugging remotely.
greetings
|
|
|
|
|
There is no such product. This is because, when running under the debugger, VB6 code is kind of interpreted, not compiled.
You can remotely debug a VB6 app, you just won't see VB6 source code. You'll see assembler, or in other cases, eqivilent C code, neither of which will resemble your original VB6 code in any way.
|
|
|
|
|
acects wrote: But I can not find anything about remote debugging in Visual Basic 6.0.
That might be due to the fact that most of us abandoned VB6. You'll get more support for Latin.
acects wrote: Is it possible at all?
Stick to OutputDebugString while you're in VB6.
Bastard Programmer from Hell
|
|
|
|
|
I have two reports, done with Crystal Reports, in my project currently. I'm forever having trouble with Crystal Reports and these problems are now causing deployment problems. I'm getting very tired of fighting thru the myriad of problems I've had with Crystal Reports and I want to explore the possibility, desirability of eliminating CR from my project altogether and producing these reports in a diffferent manner.
I would like to know what others have found best.
The reports that I currently have are pretty rudimentary. Just some simple formatting; no graphics, tables, colors, etc.
I know of three other possibilities; 1) using the Report capabilities of VS, 2) automating Word from VS, or 3) writing a text file from VS and then using Word VBA to manipulate it to produce the reports.
Do you know of any others?
Of the options that I've thought of; keeping Crystal Reports, Microsoft Reporting Services, automating Word, and passing a text file to Word; would you consider any of these to be superior to the others? Which way should I go?
I don't know how to do any of these ways. I will have to learn. So, the difficulty, or ease, of the learning process is definitely a consideration.
Any advice or words of wisdom that you might have for me would be greatly appreciated. Thank you.
|
|
|
|
|
I use Reporting Services. It's not much different than Crystal Reports, but I found it far more stable.
Automating Word is about the worst thing you could possibly do to generate a report.
No, scratch that. Writing a text file, then using VBA in Word to create the report in Word is about the worst thing you could do.
|
|
|
|
|
Thank you Dave. You gave me just what I needed and I appreciate it. Another person advised me to use Reporting Services and that is now what I intend to do. I've got some 'book learning' to do but I'm now ready to go. You saved me from going down the wrong road. Thanks. Jack
|
|
|
|
|
I don't know exactly what you're trying to accomplish but I never ever use Crystal Reports. Controlling the printer (in VB 6 at least) is a very simple process.
dim something as stdfont to allow you to change fonts and their characteristics during the run (Don't use the printer font properties for this they don't work well) stdfont is a standard type supplied in VB 6.
Open the printer
set the fonts in the something variable
position the printer cursor using printer.currentx and printer.currenty
Line spacing (kerning) is determined by the font, of course. You can use printer.currenty to override that.
dump the text using printer.print "sometext" If you want all the output on the same line then add a ; (printer.print "sometext";) and you can avoid the printer.currenty statement.
and repeat.
If you're printing a columnar report, add a test to determine end of page (the printer dimensions are twips) I usually leave 1/2" = 720 twips of air @ the bottom to allow for the different unprintable areas
printer.newpage ejects the page
end the job with printer.enddoc
abort using printer.killdoc
If the output exceeds 1 page you'll probably want to have a heading procedure. Printer.page tells you the page number that you can add to your report if you feel like it.
I have used this for over 10 years to print all kinds of reports including form filling.
Murray
|
|
|
|