把值付给变量,报错 "object reference not set to an instance of an object"什么意思
SqlConnection conn = new SqlConnection("Data Source=ZHANGYANG-PC;Initial Catalog=AdventureWorks;Integrated Security=True");
ms = EmDropdown.SelectedItem.Text;
SqlCommand EmDropdownAdapter = new SqlCommand("select EmployeeID,MaritalStatus,BirthDate from HumanResources.Employee where Title = ms ",conn);
EmDropdownAdapter.CommandType = CommandType.Text;
SqlConnection conn = new SqlConnection("Data Source=ZHANGYANG-PC;Initial Catalog=AdventureWorks;Integrated Security=True");
ms = EmDropdown.SelectedItem.Text;
SqlCommand EmDropdownAdapter = new SqlCommand("select EmployeeID,MaritalStatus,BirthDate from HumanResources.Employee where Title = ms ",conn);
EmDropdownAdapter.CommandType = CommandType.Text;
解决方案 »
- 请问大家有什么方式可以让服务器端数据验证与客户端(js)数据验证,使用同一个规则,比如:同一个配置文件这样的。
- aspnetpager分页 url问题
- MasterPage
- 怎么让鼠标指针放在下拉框选项的时候会出现提示?
- Excel打印与ASP。NET的C#
- asp.net 中如何实现文件的备份?
- 急!急!急!急求帮助!
- ajax2.0问题
- 能否在sql的执行语句中使用pl/sql块,环境server 2003+vs.net+oracle8i,关注!在线等待...
- 急救
- 超时时间已到,但是尚未从池中获取连接。出现这种情况可能是因为所有池连接均在使用,并且达到了最大池大小。 !
- 怎样运行网上下载的asp.net源代码
String ms = EmDropdown.SelectedItem.Text;
SqlCommand EmDropdownAdapter = new SqlCommand("select EmployeeID,MaritalStatus,BirthDate from HumanResources.Employee where Title = '" + ms + "'",conn);
EmDropdownAdapter.CommandType = CommandType.Text;
ms = EmDropdown.SelectedItem.Text; 这报错了吧?
EmDropdown或者EmDropdown.SelectedItem是null了