As the comment says: review the connection string change it to something that works in your environment. For instance, if you only have Express Edition installed, Data Source should probably be (local)\SQLEXPRESS. The static members below are the input values used in InsertTbl. In a real-world program they might be populated from user input one way or another. To compile it, open a Visual Studio command prompt and say: csc clientcode.cs If you do not have Visual Studio installed, there is a C# compiler in C:\Windows\Microsoft.NET\Framework\v4.0.30319 or the corresponding on your computer that you can use. (I'm sorry for readers on Linux, but I have no knowledge on how to use C# on Linux, so you will have to work that out on your own.)