how does petapoco work

Home / Uncategorized / how does petapoco work

Question:
can i do this without getting the connection string from the web config?`
public class DataPetapoco
{
public Database Db()
{
string serverName = ".\SQLEXPRESS;";
string dbName = "db";
string username = "user";
string password = "123";

var connectionstring = "Data Source=" + serverName +
";Initial Catalog=" + dbName +
";User ID=" + username +
";Password=" + password +
";Max Pool Size=200;Pooling=true" +
";Connect Timeout=20";

return new Database(connectionstring , "System.Data.SqlClient");
}
}
and then usage be something like this?
var res = DataPetapoco.Db().Fetch("select * from table");
its working fine offline but when you take to the vps server it doesnt do anything. help me please i dont want to change this to get the connection string from web config


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *