
欢迎光临我的博客: http://smallfools.blog./default.html
https://www.bc-cn.net/bbs/dispbbs.asp?boardID=113&ID=63171&page=1
一、先检查你的数据库是否存在。如,检查数据库test是否存在。
二、检查你的数据库的用户是否存在。如,检查test数据库里的smallfools用户是否存在,如果不存在的话,那么用户就是sa。
三、检查你的数据库用户对数据库的操作权限。如smallfools的权限,是owner、还是datareader、或都是datawriter,一般都用owner。
四、查看你的SQL联接语句是否正确,如data source=(local);initial catalog=test;persist security info=False;user id=smallfools;pwd=smallfoostest
如果你是本机的数据库,data source就用(local),注意要有括号,如果不是本机的数据库,就用IP,这时不要用括号。userid和pwd要和上面设置的一样。
五、检查你的防火墙,看看是不是禁止了数据库或asp.net访问网络。
说明:以上操作是针对SQL server数据库
上传文件(图片)到数据库的例子:
http://smallfools.blog.hexun.com/3302088_d.html
上传在数据库里的图片显示的例子:
http://smallfools.blog.hexun.com/3305735_d.html
上传文件(图片)到服务器的例子:
http://smallfools.blog.hexun.com/3199668_d.html