Page

Combobox select item in dropdown list C#



First Method

comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;


Second Method

Bind a Windows Forms ComboBox or ListBox Control to Data

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Web;
using System.Configuration;
using System.Data.SqlClient;


namespace VehicleDetails.Report
{
    public partial class LoanForm : Form
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbcon"].ConnectionString);
        public LoanForm()
        {
            InitializeComponent();
            bind();

        }

      private void bind()
         {
            con.Open();
            SqlDataAdapter da = new SqlDataAdapter("Select ID,Veh_Number from Vehicle_Detail where Pur_Loan='Yes'", con);
            DataTable dt = new DataTable();
            da.Fill(dt);
            DataRow dr;
            dr = dt.NewRow();
            dr.ItemArray = new object[] { 0, "-----Select Vehicle Number-----" };
            dt.Rows.InsertAt(dr, 0);
            comboBox1.DisplayMember = "Veh_Number";
            comboBox1.ValueMember = "ID";
            comboBox1.DataSource = dt;
            con.Close();
        }
}

Writing text on an image with CSS


HTML CODE       
 
<div class="image">
       <asp:Image ID="Image1" runat="server" ImageUrl="images/career.jpg" />
 <h2>Carrer With Us<br />sourcecodernp.blogspot.com</h2>
</div>




CSS CODE

.image { 
   position: relative; 
   width: 100%; 
}

h2 { 
   position: absolute; 
   top: 200px; 
   left: 0; 
   width: 100%; 

}




OUTPUT




How to Create a Bootable USB Drive Without Using Any Software


STEP 1:- Insert your USB flash drive to your running computer. As the first step, we need to run Command Prompt as administrator. To do this, we need to find cmd by typing 'cmd' in the search box on Windows Start Menu. After search result for 'cmd' appears, right click on it and select "Run as administrator".


STEP 2 :- Type 'diskpart' on Command Prompt (without quotes) and hit Enter. Wait for a while until the DISKPART program run.




STEP 3 :- Type 'list disk' to view active disks on your computer and hit Enter. There would be seen that the active disks shown as Disk 0 for hard drive and Disk 1 for your USB flashdrive with its total capacity.



STEP 4 :- Type 'select disk 1' to determine that disk 1 would be processed in the next step then hit Enter.



STEP 5 :- Type 'clean' and hit Enter to remove all of data in the drive.

STEP 6 :- Type 'create partition primary' and hit Enter. Creating a primary partition and further recognized by Windows as 'partition 1'.

STEP 7 :- Type 'select partition 1' an hit Enter. Choosing the 'partition 1' for setting up it as an active partition.

STEP 8 :- Type 'active' and hit Enter. Activating current partition.

STEP 9 :- Type 'format fs=ntfs quick' and hit Enter. Formatting current partition as NTFS file system quickly.

STEP 10 :- Type 'exit' and hit Enter. Leaving DISKPART program but don't close the Command Prompt instead. We would still need it for next process.