asp.net - how to connect to database -


i have managed connect database using localhost using sqlexpress, connection string correct, hosted on 123-reg , cannot connect database created on server. have tried sql insert , select statements see if website can connect when viewed on website live, not connect. connection fails, not sure if linking server correctly.

123-reg gave me connection string insert webconfig page:

<add key="connectionstring" value="*****; database=*****; user id=*****; password=*****" /> 

i have tried access on aspx page using:

    dim con new sqlconnection     dim cmd new sqlcommand     try         con.connectionstring = "provider=*****;datasource=*****; initial catalog=*****; user id=*****; password=*****;"          con.open()         cmd.connection = con         cmd.commandtext = "insert test (note) values ('works')"         cmd.executenonquery()       catch ex exception         msgbox("error while inserting record on table..." & ex.message)             con.close()         label1.text = "works"     end try 

they give you: provider sqloledb,

this means should use oledb classes (oledbconnection, oledbcommand etc.) not classes in sqlclient namespace (sqlconnection, sqlcommand etc).

if true , not offer alternative more updated sql native client, think have change code use these classes (or change provider)


Comments

Popular posts from this blog

php - Dynamic url re-writing using htaccess -

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -