Showing posts with label scenario. Show all posts
Showing posts with label scenario. Show all posts

Thursday, March 29, 2012

Separating my VB classes into different files

Here's my scenario: I have a page default.aspx with the header directive
<%@dotnet.itags.org. Page aspcompat=true Language="VB" Debug="true" Inherits="forms" src="http://pics.10026.com/?src=forms.vb"%>
So I have the file forms.vb that contains the class "Forms", and that class references some custom controls I've made such as "FormPageControl" and it works just fine when I have FormPageControl defined in forms.vb, which I can do, but I want to be able to give it its own vb file, so I made a file called "FormPageControl.vb" and moved the class into that file. But how do I link forms.vb to FormPageControl.vb (like in C++ I would use the line: #include "FormPageControl.h" is there something simmilar in VB.NET so that the Just in Time compiler knows to look in FormPageControl.vb for the class named FormPageControl?

Is FormPageControl a user control? If so just use the @.Controltag to declare it on the aspx page and put it in a separate ascx file.
http://www.ondotnet.com/pub/a/dotnet/excerpt/progaspdotnet_14/index1.html

FormPageControl is a vb class that inherits Repeater. There is no ascx file associated with it
What's the error you are getting when you try to compile? Make sure you have the appropriate Imports statement.

Monday, March 26, 2012

Serial port connection from .aspx form

H? all,

Can i connect to serial port from .aspx page? Is this possible?

The scenario is like to this:

Our computer is connected to a barcod label printer via the com port. And when i call an aspx in this computer, can i connect to the printer via the com port? I know that SerialPort control can only be used in WindowsApplications, but i can't find the solution? I must connect to the printer..

Regards..

There is aSerialPort class in the 2.0 version of the .NET Framework.

If you just need to print, it would be easier to use the built in printer drivers than to mess with a serial port (the PrintDocument class).

I would even shell out to DOS and use the primitive print command before dealing with a Serial port...ack, nack?


Thank you all but i solved it by using a batch file and windows service/windows app. by using SerialPort class.

Saturday, March 24, 2012

Serialize/Send a recordset content through network

Hi, the scenario should be like this:
I have a "Server" application, and a UserControl running on an asp.net page.
The UserControl sends a SQL Query string via UDP to the Server (after some
sort of authentication, etc etc)
The Server Application executes the query on his local SQL2k server
The Server Application gets the recordset returned by query execution
Then the server application sends to the UserControl the recordset returned
by the query execution
Could this be done? Like using a sort of Serialization of the SQLDataReader?
Or should i use another tecnique?
My target is to avoid opening the SQLServer directly to the public internet,
but to redirect all the queryes to my application, using some sort of
authentication and encryption.
I'm nearly new to .net framework so i'm discovering new things every day.
Thanx a lot for the help, and for any link that will be useful
MarcoMarco:
The scenario you describe sounds very much like a case where you would use a
web service. Since web services already use XML and SOAP, you will have the
serialization in the format you require.
David Lloyd
MCSD .NET
http://LemingtonConsulting.com
This response is supplied "as is" without any representations or warranties.
"M. Simioni" <m.simioniREMOVETHIS@.TOCONTACTMEwooow.it> wrote in message
news:1RRee.7789$TR5.6704@.news.edisontel.com...
> Hi, the scenario should be like this:
> I have a "Server" application, and a UserControl running on an asp.net
page.
> The UserControl sends a SQL Query string via UDP to the Server (after some
> sort of authentication, etc etc)
> The Server Application executes the query on his local SQL2k server
> The Server Application gets the recordset returned by query execution
> Then the server application sends to the UserControl the recordset
returned
> by the query execution
> Could this be done? Like using a sort of Serialization of the
SQLDataReader?
> Or should i use another tecnique?
> My target is to avoid opening the SQLServer directly to the public
internet,
> but to redirect all the queryes to my application, using some sort of
> authentication and encryption.
> I'm nearly new to .net framework so i'm discovering new things every day.
> Thanx a lot for the help, and for any link that will be useful
> Marco
>
Well, i forgot to mention, but i also need to fire events from the server
application to the user control.
The goal of the server application isn't only to be a 'forwarder' of sql
query commands from clients to db, but also should fire events to client
when something happens (like packets received from the rs232 located on the
server).
I planned to use an exchange of UDP message between the 'server application'
and the user control to exchange events (from srvr -> client) and sql
queryes (from client->srvr). But i couldn't realize how to exchange sql
resulting recordsets.
Can i do this with web services too? or should i split the two tasks in
a) a server application that send udp messages to 'clients'
b) a web service that the 'clients' use to query the database
sorry for my bad english :)
Marco
"David Lloyd" <info@.LemingtonConsulting.com> ha scritto nel messaggio
news:ZNSee.3282$0i3.1968@.bignews3.bellsouth.net...
> Marco:
> The scenario you describe sounds very much like a case where you would use
> a
> web service. Since web services already use XML and SOAP, you will have
> the
> serialization in the format you require.
>
> --
> David Lloyd
> MCSD .NET
> http://LemingtonConsulting.com
> This response is supplied "as is" without any representations or
> warranties.
>
> "M. Simioni" <m.simioniREMOVETHIS@.TOCONTACTMEwooow.it> wrote in message
> news:1RRee.7789$TR5.6704@.news.edisontel.com...
> page.
> returned
> SQLDataReader?
> internet,
>
Marco,
You never can sent something to a client. Therefore is to much protected.
You can communicate with a client when he has on the other side a program
that accept what you sent.
I think as well that the suggestion from David can maybe be a good solution
for you. We can never see from this newsgroup if it real fits. Have a look
at this pages.
http://msdn.microsoft.com/library/d...r />
hrough.asp
I expect however as well, that trying to reach your goall with a recordset
can be much harder than using the ADONET components.
I hope this helps,
Cor