用string.trim()例:
str="   abceedt       ".trim();

解决方案 »

  1.   

    use datareader :
    dim dr as sqldatareader
    dim command as sqlcommand
    command=new sqlcommand("select...",connection)
    commamd.connection.open
    dr=command.excutereader
    dim temp as string
    while dr.read
    temp=dr("id")
    temp=dr.getstring(0)
    end whileuse dataadapter:
    da.fill(ds,"tt")
    dim dt as datatable
    dt=ds.tables("tt")
    temp=dt.rows(index)(columnindex)
      

  2.   

    vb,其实我是在用asp.net做一个简单的bbs,每个帖子对应一个id号,请问这该如何实现?
      

  3.   

    读取字段名
    ……
    OleDbDataReader reader;
    reader =myCmd.ExecuteReader(); 
    ……
    for(int i=0;i<reader.FieldCount;i++)
    {
    string FieldName=reader.GetName(i);
             ……}