CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_web_developer_2005_express Tags:
Item Type: NewsGroup Date Entered: 5/18/2006 6:27:58 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 4 Views: 18 Favorited: 0 Favorite
5 Items, 1 Pages 1 |< << Go >> >|
Mike408
Asp.Net User
Applying ASP.NET 2.0 to custom pages5/18/2006 6:27:58 PM

0

Ok I already have a database layed out with several tables and relationships set up, and i went ahead and built a bunch of pages that I was planning on using.  While i was doing this I ran into 2 problems, the first was i wrote some SQL statements to insert data from input boxes into some tables i have in my database, i used a catch exception statement as well as a if/else statement to handle the transfer to diffirent pages like a signup succeded or failed, the problem im having is that the data isnt saving into the database. (I was modeling my code after the Video 8 in the Learning SQL server 2005 Express Edition for Beginners Video Series.... I actually got them to work......sorta....) When i test it no exceptions are thrown and it continues on like nothing went wrong.  The other Problem i ran into was i realized i wanted to use the memberships and roles provided by ASP.NET 2.0, and since i already created the pages for the site, i was wondering if there was a way to add them in.  This site isnt anything fancy at all, i wanted to try and create a app where users sign up and create an account on the site, but i also wanted to have the flexability to insert and retrieve data from the database with out having to be stuck in the templates.  Sorry for the long story im trying to give all the info possible.  Any help on this would be great!  Thanks!
RTernier
Asp.Net User
Re: Applying ASP.NET 2.0 to custom pages5/18/2006 6:37:06 PM

0

Can you paste your insert code?

It seems like you've not calling the insert's on the Command objects, or the update on the DataSet.

If you can show your code it'd be more helpful.


The Killer Ninja Coding Monkeys thank those that mark helpful posts as answers.

My Site | My Examples | My Blog
Mike408
Asp.Net User
Re: Applying ASP.NET 2.0 to custom pages5/18/2006 7:12:12 PM

0

Ok Well i wasnt really trying to show my code cause its might be embarassing.......  Im going to be honest...  Im new and the only way im gonna learn is if somebody shows me whats goin on.  Here what i got:


<%@ 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 Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

Dim ABCdataSource As New SqlDataSource()
        ABCdataSource.ConnectionString = ConfigurationManager.Connection
Strings("ABCConnectionString1").ToString

ABCdataSource.InsertCommandType = SqlDataSourceCommandType.Text
        ABCdataSource.InsertCommand = "INSERT INTO EmailID (EmailAddress) VALUES (@EmailAddress)"
        ABCdataSource.InsertCommand = "INSERT INTO HandleID (HandleInput) VALUES (@Handle)"
        ABCdataSource.InsertCommand = "INSERT INTO PasswordID (Password) VALUES (@Password)"
        ABCdataSource.InsertCommand = "INSERT INTO DateTime (DateTime) VALUES (@DateTime)"
        ABCdataSource.InsertCommand = "INSERT INTO IPAddress (IPAddress) VALUES (@IPAddress)"
        ABCdataSource.InsertParameters.Add ("EmailAddress", EmailAddress.Text)
        ABCdataSource.InsertParameters.Add("Handle", HandleInput.Text)
        ABCdataSource.InsertParameters.Add("Password", Password.Text)
        ABCdataSource.InsertParameters.Add("DateTime", DateTime.Now())
        ABCdataSource.InsertParameters.Add("IPAddress", Request.UserHostAddress.ToString())
       
       
        Dim rowsAffected As Integer = 0
       
        Try
            rowsAffected = ABCdataSource.Insert()
           
        Catch ex As Exception

            Server.Transfer("SignupFailed.aspx")
        Finally
            ABCdataSource = Nothing
??????? End Try
???????
??????? If rowsAffected <> 1 Then
??????????? Server.Transfer("SignupFailed.aspx")
??????? Else
??????????? Server.Transfer("ProfileDetailsPage.aspx")
\n??????? End If

End Sub

??? Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)

??? End Sub
<\u002fscript>


\n




--
",1] ); D(["mb","
~[MikE]~\n\n
",0] ); D(["ce"]); //-->
        End Try
       
        If rowsAffected <> 1 Then
            Server.Transfer("SignupFailed.aspx")
        Else
            Server.Transfer("ProfileDetailsPage.aspx")
        End If

End Sub

    Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)

    End Sub
</script>

Mike408
Asp.Net User
Re: Applying ASP.NET 2.0 to custom pages5/18/2006 7:19:00 PM

0

Hey something happened when i cut and pasted that.... a bunch of garbage came with it.... lemme try that again.....

<%@ 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 Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

Dim ABCdataSource As New SqlDataSource()
        ABCdataSource.ConnectionString = ConfigurationManager.ConnectionStrings("ABCConnectionString1").ToString

ABCdataSource.InsertCommandType = SqlDataSourceCommandType.Text
        ABCdataSource.InsertCommand = "INSERT INTO EmailID (EmailAddress) VALUES (@EmailAddress)"
        ABCdataSource.InsertCommand = "INSERT INTO HandleID (HandleInput) VALUES (@Handle)"
        ABCdataSource.InsertCommand = "INSERT INTO PasswordID (Password) VALUES (@Password)"
        ABCdataSource.InsertCommand = "INSERT INTO DateTime (DateTime) VALUES (@DateTime)"
        ABCdataSource.InsertCommand = "INSERT INTO IPAddress (IPAddress) VALUES (@IPAddress)"
        ABCdataSource.InsertParameters.Add ("EmailAddress", EmailAddress.Text)
        ABCdataSource.InsertParameters.Add("Handle", HandleInput.Text)
        ABCdataSource.InsertParameters.Add("Password", Password.Text)
        ABCdataSource.InsertParameters.Add("DateTime", DateTime.Now())
        ABCdataSource.InsertParameters.Add("IPAddress", Request.UserHostAddress.ToString())
      
      
        Dim rowsAffected As Integer = 0
      
        Try
            rowsAffected = ABCdataSource.Insert()
          
        Catch ex As Exception

            Server.Transfer("SignupFailed.aspx")
        Finally
            ABCdataSource = Nothing
        End Try
      
        If rowsAffected <> 1 Then
            Server.Transfer("SignupFailed.aspx")
        Else
            Server.Transfer("ProfileDetailsPage.aspx")
        End If

End Sub

    Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)

    End Sub
</script>
RTernier
Asp.Net User
Re: Applying ASP.NET 2.0 to custom pages5/23/2006 11:03:16 PM

0

What's happening is you're overwriting the insert command each time. The InsertCommand is a string, so each time you put : .InsertCommand = "" you are overwriting what was in it previously.

If you want to do 5 seperate UPdates, you'll want to hit the DB 5 times, or create a StoredProcedure o do all 5 updates for you.

What is your Table Structure? If all of these fields are in the Same table, write your InsertCommand like:

INSERT INTO MyTable(EmailAddress, HandleInput, Password, DateTime, IPAddress) VALUES (@EmailAddress, @Handle, @Password, @DateTime, @IPAddress)

And then add your parameters.


The Killer Ninja Coding Monkeys thank those that mark helpful posts as answers.

My Site | My Examples | My Blog
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Beginning SharePoint 2007: Building Team Solutions with MOSS 2007 Authors: Amanda Murphy, Shane Perran, Pages: 552, Published: 2007
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
ASP. NET V. 2. 0-the Beta Version: The Beta Version Authors: Alex Homer, Dave Sussman, Rob Howard, Pages: 620, Published: 2004
ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007
Professional ASP.NET 2.0 Security, Membership, and Role Management Authors: Stefan Schackow, Pages: 611, Published: 2006
Pro ASP.NET 2.0 in VB 2005: special edition. Authors: Laurence Moroney, Matthew MacDonald, Pages: 1360, Published: 2006
A First Look at ASP.NET V. 2.0 Authors: Alex Homer, Dave Sussman, Rob Howard, Pages: 528, Published: 2004

Web:
Book Review: ASP.NET 2.0 Web Parts in Action Dec 29, 2006 ... Furthermore, applying all the concepts learned in the book to the ... JavaScript with ASP.NET 2.0 Pages - Part 1 ASP.NET 2.0 has made quite ...
Ground Up: Master Pages in ASP.NET 2.0 Jul 24, 2006 ... NET v1.x. In fact, dotnetjunkies.com used a custom master page solution to keep ... Master Pages and Themes in ASP.NET 2.0 ...
ASP.NET.4GuysFromRolla.com: Examining ASP.NET 2.0's Membership ... Dec 7, 2005 ... (See A Look at ASP.NET 2.0's Provider Model for more information on .... You can use this class directly from your ASP.NET pages as well. ...
asp.net2.0 en Gennio NET.4GuysFromRolla.com: Custom Paging in ASP.NET 2.0 with SQL Ser. .... Attributes to consider applying when writing a custom control - Eilon. ...
Extending the ASP.NET 2.0 Resource-Provider Model In ASP.NET 2.0, we can use localization API functions from any page or user ... A custom resource provider includes a ResourceProviderFactory and at least ...
Total Training: Course Outline - ASP.NET 2.0 (Set 2) Total Training for Microsoft ASP.NET 2.0 Building Web Applications Set 2 ... Creating New Content Pages 8. Editing & Applying Themes to a Master Page ...
Applying a theme to a custom created WebPart in ASP.NET 2.0 - ASP ... Applying a theme to a custom created WebPart in ASP.NET 2.0 ... I can apply a theme to a Calendar Control that is added to the page outside a webpart, ...
Amazon.com: ASP.NET 2.0 Beta Preview: Bill Evjen: Books NET, this book will give you a head start in understanding and applying ASP.NET 2.0. ... Professional Web Parts and Custom Controls with ASP.NET 2.0 (Wrox ...
15 Seconds : New Files and Folders in ASP.NET 2.0 With the release of ASP.NET 2.0, Microsoft has greatly increased the power of ASP ... Applying Themes to an ASP.NET Page. Once you create the custom themes, ...
ASP.NET Training | ASP .NET Training | ASP NET Training | .NET ... NET 2.0 provides in-depth coverage of ASP.NET 2.0 for both C# 2005 and ... the internal composition of the Page type and the details of building custom user ...

Videos:
django: Web Development for Perfectionists with Deadlines Google TechTalks April 26, 2006 Jacob Kaplan-Moss ABSTRACT Django is one of the premier web frameworks for Python, and is often compared to Ruby-on...






really struggling with my custom role provider

help getting smtp email server to work with ssl asp.net 2.0 iis6

user profiles and administratively updating them

help here please!

questions about some fields in member table

organizing roles and user for an enterprise system.

file download

formsidentity vs genericidentity

session.timeout ?

how to check who is currently logged in (asp.net 1.1)

how does md5 gusrantee uniqueness?

how-to authenticate domain users in asp.net

change an item in loginview -> rolegroups -> asp:rolegroup

how to keep "aspnet_state" service in start mode permanantly? -help

problem in calling a web service using wse 3.0

loginview/loginstatus not updating after validateuser()

images disappearing when logged in using roles

createuserwizard last step dosnt appear

passing credentials from one page to the next

making windows auth behave like forms auth

runtime error followed by aspnet_regiis message

wmi/wsh script problem

(401) unauthorized with httpwebrequest

ssl on specific pages

change the connection string name for a membership provider at runtime

login

how can i change formsauthentication redirectfromloginpage url

write permissions with windows xp and asp.net 2.0

how to create simple example usin forms authentication

asp.net can't tell user identity on first load

   
  Privacy | Contact Us
All Times Are GMT