Hi @Cyber Learning ,
When there is any update on your data source, you can call DataBind()
again to reload the data source. Here is simple example:
protected void Button1_Click(object sender, EventArgs e)
{
string constr = ConfigurationManager.ConnectionStrings["conStr"].ToString();
using (SqlConnection conn = new SqlConnection(constr))
{
string cmdString = "INSERT INTO dbo.DDLItems VALUES (5,'Item5','Value5')";
conn.Open();
using (SqlCommand comm = new SqlCommand(cmdString, conn))
{
comm.ExecuteNonQuery();
}
}
ddlUsage1.DataBind();
}
Result:
Best regards,
Xudong Peng
If the answer is the right solution, please click "Accept Answer" and kindly upvote. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.