|
-
April 21st, 2010, 02:35 PM
#1
Newbie coder needs help with code
Hi there fellow forumers.
I need your help with a small and simple interface im creating similar to an order form.
Its written in ASP.NET and VB.
I have 3 main files im coding from : webserice.asmx, webservice.vb and default.aspx
I only have one webservice at the moment, it is primitive and simple and here is what it looks like :
i left out the var declarations and headers
*****************************************************************
Code:
conn.Open()
cmd = conn.CreateCommand()
cmd.CommandText = "INSERT INTO cdReq ([serial], [branch], [client], [status], [email], [address], [reason], [betaal], [bankBes], [reqDate], [regDate]) VALUES('" + serial.ToString + "', '" + branch + "', '" + client + "', '" + status + "', '" + email + "', '" + address + "', '" + reason + "', '" + betaal + "', '" + bankBes + "', '" + reqDate + "', '" + regDate + "')"
cmd.ExecuteNonQuery()
conn.Close()
When i run JUST that service i can update the database sucessfully(using debugging mode)
but when i try to update the database from my own interface(webservices.vb) it wont update it at all, and i really dont know where to look for my problem(all 3 files compile)
Here is the code for the Webservices.vb file :
Code:
Option Strict On
Imports System
Imports System.Collections
Imports System.Data
Imports System.Data.OleDb
Imports Microsoft.VisualBasic
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Public Class Cdform : Inherits Page
Protected txtSerial As TextBox
Protected txtEmail As TextBox
Protected txtRegDate As TextBox
Protected txtReqDate As TextBox
Protected txtBranch As TextBox
Protected txtClient As TextBox
Protected txtAddress As TextBox
Protected txtReason As TextBox
Protected txtStatus As TextBox
Protected txtBank As TextBox
Protected txtPay As TextBox
Protected cmdSubmit As Button
'====================================
Public Sub cmdSubmit_click(ByVal sender As Object, ByVal e As EventArgs)
Dim myService As New Service1
myService.addCD(txtSerial.text, txtBranch.text, txtClient.text, txtStatus.txt, txtEmail.text, txtAddress.text, txtReason.text, txtPay.text, txtBank.text, txtReqDate.text, txtRegDate.text)
End Sub
End Class
'=========================================
As far as i know i called the procedure correctly, giving all the var to the "Add cd" proc but it just wont update.
Any help please?
Last edited by HanneSThEGreaT; April 22nd, 2010 at 02:53 AM.
-
April 22nd, 2010, 02:11 AM
#2
Re: Newbie coder needs help with code
Please go back and edit your code to use Code Tags
-
April 22nd, 2010, 02:53 AM
#3
Re: Newbie coder needs help with code
-
April 22nd, 2010, 10:43 AM
#4
Re: Newbie coder needs help with code
Hey there, i will from now on make sure to put my code in the tags.
What i found whas that it isnt the code withing my codebehind file that isnt working, its the fact that my Default.aspx is not detecting my codebehind file, even though i referenced it at the start of my page on default.aspx :
Code:
<%@ Page Title="Home Page" Language="VB" codebehind="WebService.vb" %>
What else could i add, or what else could i test to see why my main Default.aspx file isnt reading and using the code from my Codebehind file "Webservice.vb
-
April 22nd, 2010, 10:58 AM
#5
Re: Newbie coder needs help with code
what does the code for your submit button look like (not the VB code, but the asp side of it.)
-tg
-
April 29th, 2010, 01:34 AM
#6
Re: Newbie coder needs help with code
Thank you Tech, i forgot to add the onclick attribute :
Code:
<asp:Button ID="cmdSubmit" onclick="cmdSubmit_click" runat="server"
Text="Submit"/>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|