Re: Desperately need help to setup with asp net !!





You might look into

"web service"
or
"remoting"

I have a sample remoting service at:
http://sholliday.spaces.msn.com/ 9/27/2005 entry. (You may have to "View
More" at the bottom to find it)


If you have biz logic in your winforms presentation layer, then I don't know
what youre going to do.
I've never heard of talking to a windows application from a web page. I'm
not saying it can't be done, but 10 years in the business, I've never heard
of it.


I understand I'm not answering your question exactly. That's because I
don't know what the answer is.




<pamelafluente@xxxxxxxxx> wrote in message
news:1151268220.863538.69320@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thank you Ken. This piece of the puzze I already have.

The problem is I want to send the request to a VB.NET program which is
running on the server because it must do some complicate processing
*before* doing the query and *after* doing the query. The response page
is not simply to fill a grid but the result of some processing that
must be done by the Vb.net application on the server. The VB.net
application also prepare a complex response page (with a lot of more
stuff, charts, pictures, photos, diagrams, etc) which I would like to
return to the browser.

What I have hard time to implement is passing data from the browser to
the VB.net application on the server, and, then, passing back the page
generated by the VB.net program back to the Browser. Just as I have
indicated in my schema. If you bypass the VB application you are not
answering to my original question. It's crucial the dialogue with the
server application.

Thanks for any help.

-Pam

Ken Cox [Microsoft MVP] ha scritto:

Hi Pam,

This sounds like a fairly simple ASP.NET page. Not sure why your spec
includes a "vb net application on a server pc" because the ASP.NET page
can
do it all... that's what it was designed for.

Anyway, let us know if the ASP.NET 2.0 code below helps?

Ken
Microsoft MVP [ASP.NET]


<%@ page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<script runat="server">

Protected Sub btnSubmit_Click _
(ByVal sender As Object, ByVal e As System.EventArgs)
If txtQuery.Text <> "" Then
' Quick sample code to submit a SQL string
' and view the results in ASP.NET Gridview
' Ken Cox [MVP] - June 25/06
Dim strConnection As String
strConnection = "Data Source=.\SQLEXPRESS;" & _
"Initial Catalog=Northwind;Integrated Security=True"
Dim con As New Data.SqlClient.SqlConnection(strConnection)
' The following is probably not sufficient to protect you
' from a SQL injection attack but it's better than nothing
Dim cmdtext As String = SafeSqlLiteral(txtQuery.Text)
Dim cmd As New Data.SqlClient.SqlCommand(cmdtext, con)
Dim ds As New Data.DataSet
Dim da As New Data.SqlClient.SqlDataAdapter _
(cmdtext, strConnection)
da.Fill(ds)
GridView1.DataSource = ds
GridView1.DataBind()
End If
End Sub

Private Function SafeSqlLiteral(ByVal inputSQL As String) As String
Return inputSQL.Replace("'", "''")
End Function

</script>

<html xmlns="http://www.w3.org/1999/xhtml";>
<head runat="server">
<title>Textbox SQL query</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:textbox id="txtQuery" runat="server" width="470px"
text="SELECT companyname from customers"></asp:textbox><br />
<br />
<br />
<asp:button id="btnSubmit" runat="server"
onclick="btnSubmit_Click" text="Submit query" /><br />
<br />
<br />
<asp:gridview id="GridView1" runat="server">
</asp:gridview>
&nbsp;</div>
</form>
</body>
</html>

<pamelafluente@xxxxxxxxx> wrote in message
news:1151249546.731638.175320@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am beginning aspNet, I know well win apps.
Need a simple and schematic code example to start work.

This is what I need to accomplish:

----------------------
Given button and a TextBox on a web form when one presses the button
on
the web form on a client pc, the sql query which is contained in the
text box is sent to a vb net application on a server pc. The win
application sends the query to the database, collects the results,
creates a web page showing some of these result and send the page back
to the browser (for future queries).

1. client (Browser, IE) ----> WinApp on a Server pc ----> Database
2. Database --> WinApp on Server pc --> create NewAspPage --> client
pc (Browser)
----------------------

I am kind of desperate and I don't know where to start . I very
*simple* example in code would really help a lot.

Help!!

-Pam




.