char和string之间的转换解决办法

char和string之间的转换
一个DropDownList里面是一个新闻类型,
当选择一个类型时传入一个string的数据到一个GetNews类中,
这个类中用到存储过程,
存储过程中接收一个vchar(10)的参数,
如何将string类型转为char类型从而进行数据库查找?谢谢

------解决方案--------------------
不需要转换
------解决方案--------------------
不需要转换
只需要将 存储过程参数 设置成
new SqlParameter( "@yourKey ", SqlDbType.VChar, 10)
------解决方案--------------------
說明你sql語句有問題
傳遞參數的時候可能出現問題,
如下試一下
declare SqlStr varchar(200)
select SqlStr = 'select newsid,title,newscontent,subtime from news where newstypeid like ' ' '+@newstypeid + ' ' ' order by subtime desc '
exec(SqlStr)