Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8604701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:38:27+00:00 2026-06-12T02:38:27+00:00

hi i used this query for update my db but not working : if

  • 0

hi i used this query for update my db but not working :

if (Request["mode"] != null)
        {
            Int32 ID = Int32.Parse(Request["Id"].ToString());
            using (NoavaranModel.NoavaranEntities1 dbContext = new NoavaranModel.NoavaranEntities1())
            {
                var ToEdit = (from n in dbContext.Packages
                                  where n.Id == ID
                                  select n).FirstOrDefault();
                ToEdit.Name = txtName.Text;
                ToEdit.Level = txtLevel.Text;
                ToEdit.Description = txtDescription.Text;
                ToEdit.ForAge = ddlAgeFor.SelectedItem.Text;
                ToEdit.CatId = ddlCategory.SelectedIndex + 1;
                dbContext.SaveChanges();
                //Response.Redirect("Packages.aspx");
                //return;*/
            }
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:38:28+00:00Added an answer on June 12, 2026 at 2:38 am

    i solved my problem,i was forgotten that i use the IsPostBack :

    if (!IsPostBack)
            {
                if (Request["Id"] != null)
                {
                    Int32 ID = Int32.Parse(Request["Id"].ToString());
                    using (NoavaranModel.NoavaranEntities1 dbContext = new NoavaranModel.NoavaranEntities1())
                    {
                        var query = (from list in dbContext.Packages
                                     where list.Id == ID
                                     select list).FirstOrDefault();
                        txtName.Text = query.Name;
                        txtLevel.Text = query.Level;
                        txtDescription.Text = query.Description;
                        Image2.ImageUrl = "PackageImages/" + query.Image;
                        ddlAgeFor.Text = query.ForAge;
                        //ddlCategory.Text = query.CatId.ToString();
                    }
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to update with the value in this query, but it's saying it
I have used Zend_Db_Table update on many occasions but this time I am running
I have used this query to alter the table field: ALTER TABLE `recordstudent` CHANGE
I have used this query before: SELECT * FROM stone_list WHERE type IN ('ALEXANDRITE','AMETHYST')
Once, I used this query to select the number of items in order to
I've used this MySQL query to get data: SELECT DISTINCT A.*, B.username FROM posts
Also what will be the scenarios where this query is used select * from
I used this link to create a SHA1 hash for any data using C++.
I have this table: create table demo ( key number(10) not null, type varchar2(3)
I have used this statements to populate jcombobox from MySql database table using Hibernate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.