c# - asp.net WEB API with database connection -


i'm new asp.net web api. i'm trying create apis have connections database. example login method or add data database. when tried search example tutorial, couldn't find example has connection string inside it.

my questions :

  1. how set connection string database? (i.e. user name , password)
  2. can connect database not in localhost? (i.e. server)

if explain me asp.net web api has connection database, appreciate it.

**im using visual studio 2012 right now. database use mssql.

thx

1. how set connection string database? example username , password? : better put connections string in webconfig, can change when need how to: read connection strings web.config file

2. can connect database not in localhost (for example in server): of course, first, need choose technology use access database, can use entity framework, classic ado.net, nhibernate, example entity framework read: entity framework (ef) documentation, read: using web api 2 entity framework 6


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -