Home > Net >  Novice consult with WebAPI how to add a MSSQL record
Novice consult with WebAPI how to add a MSSQL record

Time:12-15



Just learning ASP, a lot of basic do not understand, I have a BMZL MSSQL table, a total of three fields, the idea is to pass the field value parameters, a new SQL records, but red which sentence is wrong, I don't know how to create a record as an example, consult

Public IEnumerable GetAdd (String strBMNo, String strBMName, String strMemo)
{
Using (LinLongHrmEntities entities=new LinLongHrmEntities ())
{

IEnumerable RowBMZL=new IEnumerable (strBMNo strBMName, strMemo);
Entities. BMZL. AddRange (rowBMZL);
Var intAdd=entities. SaveChanges ();
If (intAdd==1)
{
Yield return "new complete department data";
}
The else
{
Yield return "department information new failure";
}

}

}
  • Related