trisonics wrote:
I am in process for converting a oracle form application with oracle backend to .net front-end and oracle backend.
Basically only the front-end from will become ASP.NET page the backend remaining the same and ODP.NET for database access.
Although I am not a forms developer but I can see that the form's "post" option is a very useful functionality. For db validation etc
Can anyone tell me how to achieve the same in a .net application programmatically.
Thanks
I'm not sure if I've misunderstood you, but are you asking how to send HTML <form> data via the POST method to a website from .NET?
If so, you use something like the following:
using System.Net;
using System.Collections.Speciailized;
using System.Text;
public class Program {
private const string MySiteURI = "http://localhost/test.aspx";
public static void Main(string[] args){
NameValueCollection postData = new NameValueCollection();
postData.Add("key", "value");
WebClient webby = new WebClient();
byte[] response = webby.UploadValues(new Uri(MySiteURI), postData);
string strReponse = Encoding.Default.GetString(response);
Console.WriteLine("Response: ");
Console.WriteLine();
Console.WriteLine(strReponse);
Console.WriteLine();
Console.WriteLine("Press [ENTER] to exit.");
Console.ReadLine();
}
}