login - Vb.Net Detect if application server is down -



login - Vb.Net Detect if application server is down -

i have developed .net application want share users through shared file in lan managed through domain server. when server , running fine when server shut downwards error comes. have access sql server database in server. when server shut downwards gives fatal error , application stops. how observe error of server beingness down? connecting server through next code:

dim sql string dim dacoursemaster sqldataadapter seek sqlconn = new sqlconnection(connstring) sqlconn.open() sql = " ... " dacoursemaster = new sqldataadapter(sql, sqlconn) dacoursemaster.fill(dsdataset, "table") dvregister = new dataview dvregister = dsdataset.tables("courseregisters").defaultview dgvcourseregister.datasource = dvregister grab ex exception msgbox(err.description) end seek

now there might different reasons why user can not login server: either server name wrong or user name or password wrong or thebserver might shut down! how differentiate between these reasons allow user know might reason failed login?

use code before code sharing (if code in sub):

if not my.computer.network.ping(" server name or server ip") exit sub

or (if code in function):

if not my.computer.network.ping(" server name or server ip") exit function

vb.net login detect application-server

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -