entering data to tables through form

  • hi im making my first web site using visual web developer and SQL Server 2005,i made the connection set the queries and all tht but whenever im trying to enter data to my registration form i see no change in my tables .so could somone plz tel me what might be the problem or wt am i missing here,thnx.

  • It sounds like the post changes method isn't working properly for some reason. If you can retrieve data then your connector must be working OK. I have no idea what language you're using and have very little exposure to this myself (only through Java forms), but I'd imagine the theory behind it is similar.

  • You'd need to post more information about what you are doing or what the code is.

    There could be any number of problems. If you run Profiler with your login credentials, then you could see what is being submitted to SQL Server.

  • im using asp.net and i tried to retrive data but nothing retrived from the form.

  • Good morning. Be sure that you have method = "post" in the form tag. If you don't, no data will be returned from the form. I hope that this helps. Thanks.

    Chris

  • why do post your asp.net code or sql code ?

  • I am a web developer using Visual Studio .NET. I know this is not the tool you mentioned, but I thought it might be worth mentioning that in your code, do you have the ability to determine whether or not the page is posting back. For example, in Visual Studio .NET, in the "code behind" for my page, I must specify the following in my Page_Load:

    protected void Page_Load(object sender, EventArgs e)

    {

    if (!IsPostBack)

    {

    // your logic to load the page,

    // make controls visible, enabled, etc.

    }

    }

    protected void btnSave(object sender, EventArgs e)

    {

    // your call to the database, etc.

    }

    When submitting a page, the code first calls Page_Load, then it calls btnSave (in my example). When the page loads, guess what state it's in? It's in its default state. If I have a data entry form, then all those fields default to empty strings on initial load. If a user enters a value, I don't want to lose it, so I need to include logic in my Page_Load to check if it's a post back.

    Can you put a breakpoint in your code and step through it? Then you could at least ensure that your front end is grabbing the values from the page and attempting to pass them to the database. Then as previously mentioned, use the Profiler to see what exactly is being sent to the database.

    Lisa

  • thnx alot everyone ill try the code and see if its gona work.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply