Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2006, 03:28 PM
Registered User
 
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Insert data in SQL ASP .NET 2.0.

Good morning,

I don't know why this code is not inserting data in my SQL database. It automatically returns the same webpage, without any insert in the database.

Do you know where is the error?

Thanks in advance.
Alejandro Pérez.
SPAIN

Code:
<%@ Page Language="VB" Debug="true" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Page</title>
</head>
<body>
<form id="form1" method="post" runat="server">
<asp:SqlDataSource id="ds1" runat="server"
   ConnectionString="server=62.149.153.13;database=MSSql13067;uid=MSSql13067;pwd=secret"
   SelectCommand="SELECT [usuario], [email] FROM [usuarioyemail]"
   InsertCommand="INSERT INTO [usuarioyemail] ([usuario], [email]) VALUES (@usuariocontrol, @emailcontrol)"
>
<InsertParameters>
<asp:ControlParameter Name="usuariocontrol" ControlID="usuario" Type="Char" PropertyName="Text" />
<asp:ControlParameter Name="emailcontrol" ControlID="email" Type="Char" PropertyName="Text" />
</InsertParameters>
   </asp:SqlDataSource>
    <asp:TextBox ID="usuario" runat="server"></asp:TextBox>
    <asp:TextBox ID="email" runat="server"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error while accessing SQL data from ASP.NET manisha2578 ASP.NET 1.0 and 1.1 Basics 2 February 26th, 2006 03:18 AM
Problem in insert new data in Asp.Net. Rahul Gupta ASP.NET 1.0 and 1.1 Basics 1 December 16th, 2005 10:23 AM
how to insert to data by ASP.Net with Access ngocntm Classic ASP Professional 2 September 29th, 2004 09:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.