help required pls

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sandesh964
    New Member
    • Jan 2007
    • 10

    help required pls

    i am developing an online application iv written the code using c# with asp now my code is not working when my listbox contains even number of items in it can any one help me pls here goes the code

    private void Button1_Click(o bject sender, System.EventArg s e)
    {
    OleDbConnection con=new OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;Data Source=D:/TPO/tpo.mdb;Persist Security Info=False");
    con.Open();
    int r=ListBox1.Item s.Count;
    for(int s=0;s<r;s+=2)
    {
    OleDbCommand cmd=new OleDbCommand("i nsert into messages values('"+DateT ime.Now.ToShort DateString()+"' ,'"+ListBox1.It ems[s].ToString()+"', '"+TextBox1.Tex t+"','"+TextBox 2.Text+"','Circ ular')",con);
    cmd.ExecuteNonQ uery();
    }
    ListBox1.Items. Clear();
    Label3.Visible= true;
    TextBox1.Text=" ";
    TextBox2.Text=" ";
    con.Close();
    }
    2)how can i run the application in LAN can i know the complete address format pls and the iis port number
Working...