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 4037342
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:20:10+00:00 2026-05-20T12:20:10+00:00

i’m create one web site in library management system at the one page Issue

  • 0

i’m create one web site in library management system at the one page Issue of book ok
the book is available or not available .how to check and then how to set validate controle
My coding is

public partial class Issueofbook : System.Web.UI.Page
{
    public Int64 Sid;

    protected void Page_Load(object sender, EventArgs e)
    {
        string Id;
        Id = Request.QueryString.Get(0);

        if (!(IsPostBack == true))
        {
            if (Request.QueryString.Get(1) == "G")
            {
                Sid = Convert.ToInt64(Id);
                if (PopulatedRecord(Sid) == false)
                {

                }
            }
        }
    }
    private Boolean PopulatedRecord(Int64 Id)
    {
        DataSet DS;
        DS = new DataSet();
        SqlCommand cmd = new SqlCommand();
        SqlDataAdapter da = new SqlDataAdapter();
        SqlConnection Cnn = new SqlConnection();
        string connectionstring;
        connectionstring = @"Datasource=DEVI\SQLEXPRESS;Intial                                                
                    catalog=librarymanagement;Integrated Security=SSPI";
        Cnn.ConnectionString = connectionstring;
        if (Cnn.State != ConnectionState.Open)
            Cnn.Open();
        cmd.Connection = Cnn;
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "usbinsertdatainto";
        cmd.Parameters.Clear();
        cmd.Parameters.AddWithValue("@bookno", txtno);
        da.SelectCommand = cmd;
        try
        {
            da.Fill(DS);
        }
        catch (Exception ex)
        {
            throw new ApplicationException(
               "!!! An Error Occured While Update Record In Dtl_SecurityCapital_Upload." +
           ex.Message);
            lblerror.Visible = true;
            lblerror.Text = "!!! An Error Occured While " + ex.Message.ToString();
            return false;
        }
        if (DS.Tables[0].Rows.Count > 0)
        {
            txtno.Text = DS.Tables[0].Rows[0]["bookno"].ToString();
            txtstuno.Text = DS.Tables[0].Rows[0]["studentno"].ToString();
            RadioButton1.Text = DS.Tables[0].Rows[0]["copiesavaillable"].ToString();
            RadioButton2.Text = DS.Tables[0].Rows[0]["copiesavaillable"].ToString();
            txtdate.Text = DS.Tables[0].Rows[0]["IssueDate"].ToString();
            txtddate.Text = DS.Tables[0].Rows[0]["Duedate"].ToString();
        }
        cmd.Dispose();
        Cnn.Close();
        Cnn.Dispose();
        return true;
    }

    protected void Btn_click(object sender, EventArgs e)
{
    SqlCommand cmd = new SqlCommand();
    SqlConnection cnn = new SqlConnection();
    string connectionstring;
    connectionstring =  ConfigurationManager.ConnectionStrings["librarymanagementconnectionstring"].ConnectionStri  
       ng;
    cnn.ConnectionString = connectionstring;
    if (cnn.State != ConnectionState.Open)
        cnn.Open();
    cmd.Connection = cnn;
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.CommandText = "spupdatebookdetail";
    cmd.Parameters.Clear();
    cmd.Parameters.AddWithValue("@bookno", txtno.Text);
    cmd.Parameters.AddWithValue("@studentno", txtstuno.Text);
    cmd.Parameters.AddWithValue("@Issuedate", txtdate.Text);
    cmd.Parameters.AddWithValue("@Duedate", txtddate.Text);
    if(RadioButton1.Checked ==true)
    {
        cmd.Parameters.AddWithValue("@copiesavaillable", RadioButton1.Text);
    }
    if (RadioButton2.Checked==true)
    {
        cmd.Parameters.AddWithValue("@copiesavillable", RadioButton2.Text);
    }
    try
    {
        cmd.ExecuteNonQuery();
    }
    catch (Exception ex)
    {
        throw new ApplicationException("!!! An error an occured while update the record In Dtl _captial upload." + ex.Message);
        lblerror.Visible = true;
        lblerror.Text  = "!!! An error an occured while." + ex.Message.ToString();
    }
    lblerror.Visible  = true;
    lblerror.Text  = "Record update sucessfully";
    PopulatedRecord(Sid);
}

    protected void Button_click(object sender, EventArgs e)
    {
        Server.Transfer("useraccount.aspx");
    }

    protected void Button2_Click(object sender, EventArgs e)
    {

        SqlConnection cnn = new SqlConnection();
        string constr = null;
        SqlCommand cmd = new SqlCommand();
        constr = @"Data Source=DEVI\SQLEXPRESS; Initial Catalog =librarymanagement; Integrated Security=SSPI";
        cnn.ConnectionString = constr;
        try
        {
            if (cnn.State != ConnectionState.Open)
                cnn.Open();
        }
        catch (Exception ex)
        {
            string str1 = null;
            str1 = ex.ToString();
        }
        cmd.Connection = cnn;
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "uspInsertbookDatainto";
        cmd.Parameters.Clear();
        cmd.Parameters.AddWithValue("@bookno", txtno.Text);
        cmd.Parameters.AddWithValue("@studentno", txtstuno.Text);
        cmd.Parameters.AddWithValue("@Issuedate", txtdate.Text);
        cmd.Parameters.AddWithValue("@Duedate", txtddate.Text);
        if (RadioButton1.Checked == true)
        {
            cmd.Parameters.AddWithValue("@copiesavaillable", RadioButton1.Text);
        }
        if (RadioButton2.Checked == true)
        {
            cmd.Parameters.AddWithValue("@copiesavaillable", RadioButton2.Text);
        }
        try
        {
            cmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            throw new ApplicationException("!!! An error an occured while Insert Record Dtl_SecurityCapital_Upload." + ex.Message);
            lblerror.Visible = true;
            lblerror.Text = "!!! An Error occured while ." + ex.Message.ToString();
        }

        finally
        {
            cmd.Dispose();
        }
        cnn.Close();
        lblerror.Text = "New Issue of record suceessfully!!";
        txtno.Text = "";
        txtstuno.Text = "";
        txtdate.Text = "";
        txtddate.Text = "";
    }

}
  • 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-05-20T12:20:11+00:00Added an answer on May 20, 2026 at 12:20 pm

    In your code there are a few things which look eerm strange. For instance (!(IsPostBack == true)) should probably be if (!IsPostBack). Also, you should probably check for the existence of the query string parameter and get it by name Request.QueryString["name"]
    do this instead

    string id = Request.QueryString["id"];
    if (id == null) 
    {
        // do error handling here, no id specified;
    }
    else
    {
        // use id;
    }
    

    … and more

    Could you be more specific as to what the actual problem is, other than that it does not run?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.