473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Guestbook Problems

Please take a look at this code

<%@ Page Language="VB" Debug="true"%>
<%@ Import Namespace="System.Windows.Forms" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace ="System.Web.UI.Page" %>

<html >
<head runat="server">
<title>Guestbook</title>
<script runat="server">
Sub Submit_Click(sender As Object, e As EventArgs)
Call MyInsertMethod()
End Sub
Function MyInsertMethod() As Integer
Dim MyConn As AccessDataSource
MyConn = AccessDataSource1
Dim cmd As AccessDataSource
Dim MySQL As String = "INSERT INTO Guest (FirstName, LastName) VALUES ('" &
FirstName.Text & "','" & LastName.Text & "')"
MyConn.Open() ************ Error 1 'MyConn' is not a member of
'System.Web.UI.WebControls.AccessDataSource'.
cmd.ExecuteNonQuery(MyConn, MySQL) ******** is not a member of
'System.Web.UI.WebControls.AccessDataSource'
MyConn.Close() *************is not a member of
'System.Web.UI.WebControls.AccessDataSource'
Response.Redirect("Guestlog.aspx")
End Function
</script>

Whats wrong with this lines?
I'm trying to insert FirstName LastName into Access table

Thanks
Oded Dror

Jan 31 '06 #1
1 2190
Questions :

1. why are you importing Windows.Forms for use in a web page ?
2. why are you importing System.Drawing ?
3. why are you importing System.Web.UI.Page ?

Juan T. Llibre
ASP.NET MVP
ASPNETFAQ.COM : http://www.aspnetfaq.com
==================================
"Oded Dror" <od******@cox.net> wrote in message news:eg**************@TK2MSFTNGP11.phx.gbl...
Please take a look at this code

<%@ Page Language="VB" Debug="true"%>
<%@ Import Namespace="System.Windows.Forms" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace ="System.Web.UI.Page" %>

<html >
<head runat="server">
<title>Guestbook</title>
<script runat="server">
Sub Submit_Click(sender As Object, e As EventArgs)
Call MyInsertMethod()
End Sub
Function MyInsertMethod() As Integer
Dim MyConn As AccessDataSource
MyConn = AccessDataSource1
Dim cmd As AccessDataSource
Dim MySQL As String = "INSERT INTO Guest (FirstName, LastName) VALUES ('" & FirstName.Text & "','"
& LastName.Text & "')"
MyConn.Open() ************ Error 1 'MyConn' is not a member of
'System.Web.UI.WebControls.AccessDataSource'.
cmd.ExecuteNonQuery(MyConn, MySQL) ******** is not a member of
'System.Web.UI.WebControls.AccessDataSource'
MyConn.Close() *************is not a member of 'System.Web.UI.WebControls.AccessDataSource'
Response.Redirect("Guestlog.aspx")
End Function
</script>

Whats wrong with this lines?
I'm trying to insert FirstName LastName into Access table

Thanks
Oded Dror

Jan 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dariusz | last post by:
I am a beginner in PHP and MySQL, and am working through a book and various online tutorials on PHP and MySQL and now stuck - installed everything on "localhost" and it all works fine. My question...
1
by: varois83 | last post by:
Hi I am new to PHP and am working on creating a guestbook from scratch to experiment. I am using several tutorials online. I have a question about dealing with entries made to my guestbook as...
1
by: Rune Runnestř | last post by:
Hi, I have made a small program that doesn't work quite the way it should. It is a guestbook for the web, where visitors can write back their greetings. The program consists of 3 files: -...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
2
by: Steve Schumacher | last post by:
Ok hers the scoop. I am presently On verizon DSL. I have free web space and they have a couple of free apps that you can use on your web page. One is a guest book that I have yet to get to work....
1
by: Viken Karaguesian | last post by:
Hello everyone, Just wanting some advice. I'd like to start removing the Microsoft-generated guestbook (a feature of FrontPage) on my websites but I'm not sure if it can be done just using HTML....
0
by: http://www.free-guestbook.net/gbook.php?u=21740 | last post by:
http://www.free-guestbook.net/gbook.php?u=21740 http://www.free-guestbook.net/gbook.php?u=21741 http://www.free-guestbook.net/gbook.php?u=21742 http://www.free-guestbook.net/gbook.php?u=21743
4
by: infoseekar | last post by:
HI Guys I am a beginner. I am trying to create a guestbook. I have the code for it and it is in three parts. Part 1 "dp.php" to open database and make connection Part 2 "index.php" which will...
5
Thekid
by: Thekid | last post by:
Hi, I'm using xampplite and I'm trying to make a guestbook and a forms page where you can post to the guestbook with PHP & MySQL. I got the code from a website but it wasn't working so I tinkered...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.