The problem is that your are assign query to SqlCommand before appending all tags to the query variable. Below is updated code.
protected void butt_addbook_Click(object sender, EventArgs e)
{
SqlConnection con=new SqlConnection(ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString);
con.Open();
string tag = "";
try
{
foreach (ListItem li in checkboxlist_tags.Items)
{
if(li.Selected==true)
{
tag += "," + li.Text;
}
}
tag += "," + txt_custom_tags.Text;
String query = "insert into demo_book_info values ('" + txt_bookno.Text + "','" + txt_title.Text + "','" + txt_bookauthor.Text + "','"+ tag +"','" + txt_bookcopies.Text + "','Available')";
SqlCommand cmd = new SqlCommand(query, con);
cmd.ExecuteNonQuery();
ClientScript.RegisterClientScriptBlock(Page.GetType(),"validation",
"<script language="'javascript'">alert ('Saving is Done!')</script>");
con.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message);
ClientScript.RegisterStartupScript(Page.GetType(), "validation",
"<script language="'javascript'">alert('Error!')</script>");
}