Home > OS >  asp.net web application (.net framework) unable to call daatables
asp.net web application (.net framework) unable to call daatables

Time:03-23

I am wanting to pass extra information to the sql sever only when someone creates an account successfully the problem is that I cant call the tableadapter that has my query on it. I have the dataset xsd made and the tables made but I cant seem to call to them this is done all being done in a asp.net web application (.net framework)

enter image description here

using System;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Owin;
using CAEWEBBASE.Models;

namespace CAEWEBBASE.Account
{
    public partial class Register : Page
    {
        protected void CreateUser_Click(object sender, EventArgs e)
        {

            var manager = Context.GetOwinContext().GetUserManager<ApplicationUserManager>();
            var signInManager = Context.GetOwinContext().Get<ApplicationSignInManager>();
            var user = new ApplicationUser() { UserName = Email.Text, Email = Email.Text };
            IdentityResult result = manager.Create(user, Password.Text);
            if (result.Succeeded)
            {
                <want to add call to table adapter here to pass data>
                // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771
                //string code = manager.GenerateEmailConfirmationToken(user.Id);
                //string callbackUrl = IdentityHelper.GetUserConfirmationRedirectUrl(code, user.Id, Request);
                //manager.SendEmail(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\""   callbackUrl   "\">here</a>.");

                signInManager.SignIn( user, isPersistent: false, rememberBrowser: false);
                IdentityHelper.RedirectToReturnUrl(Request.QueryString["ReturnUrl"], Response);
            }
            else 
            {
                ErrorMessage.Text = result.Errors.FirstOrDefault();
            }
        }
    }
}

CodePudding user response:

After a TUN of research I finally found the solution. first I had the dataset in the App_Data folder it needs to be in the App_Code folder for it to function as a proper dataset with tables inside. Next you have to open the dropdown on the dataset and then select the designer then change the build action to compile then rebuild your project then you will be able to access any debatable in your code behind.

  • Related