1.怎样定制VC#DataGrid列标题?
| DataGridTableStyle dgts = new DataGridTableStyle(); dgts.MappingName = "myTable"; //myTable为要载入数据的DataTable DataGridTextBoxColumn dgcs = new DataGridTextBoxColumn(); dgcs.MappingName = "title_id"; dgcs.HeaderText = "标题ID"; dgts.GridColumnStyles.Add(dgcs); 。。。 dataGrid1.TableStyles.Add(dgts); |
2.检索某个字段为空的所有记录的条件语句怎么写?
| ...where col_name is null |
3.如何在c# Winform应用中接收回车键输入?
设一下form的AcceptButton.
4.比如Oracle中的NUMBER(15),在Sql Server中应是什么?
NUMBER(15):用numeric,精度15试试。
5.sql server的应用like语句的存储过程怎样写?
select * from mytable where haoma like ‘%’ + @hao + ‘%’
6.vc# winform中如何让textBox接受回车键消息(假没没有按钮的情况下)?
| private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if(e.KeyChar != (char)13) return; else //do something; } |
7.为什么(Int32)cmd.ExecuteScalar()赋值给Int32变量时提示转换无效?
| Int32.Parse(cmd.ExecuteScalar().ToString()); |

