Skip to content

C# web project - MVC and API example to display table contents using stored procedures or SQL query

License

Notifications You must be signed in to change notification settings

yparsak/VCSWEB1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

VCSWEB1

C# WEB project that uses MVC and API frameworks. The MVC only has a default page. The following describes the API:

/api/Response?sp=STORED_PROCEDURE&ParamA=value&ParamB=value

/api/Response?query=SELECT+*+from+TableName

/api/Response?command=DROP+TABLE+TableName

Warning : This project is only for demonstration purpose. Query and Command APIs contain security risks, and they should be disabled (in Response Controller).

The API calls stored procedure using parameters described above. The result is returned as an XML document.

The format for stored procedure, and query response is:

<Response>
<data>
  <data>
     <columns>
         <ColumnA />
         <ColumnB />
     </columns>
     <rows>
       <row rowid='1' column='ColumnA' value='X'>X</row>
       <row rowid='1' column='ColumnB' value='Y'>Y</row>
     </rows>
  </data>
</data>
<status />
<type>success</type>
</Response>

The command response doesn't contain the data node.

To configure: you must modify Web.config and set ConStr (Connection String) variable.

About

C# web project - MVC and API example to display table contents using stored procedures or SQL query

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages