It's not a global function - C# has no concept of global functions or variables. I would suggest that you look into the
static
keyboard which would make these easier to use as you will not need an instance to access them.
To get rid of your existing problem, you will probably need to add a space in teh word "userid":
private static string connectionstring ="Data Source=NARASIMAN;connect timeout=120;initial catalog=HIMT;user id=sa;";
But you may find you need a password as well.
Try setting up a connection in VS with the Server Explorer pane:
1) Open Server Explorer.
2) Right click "Data connections" and select "Add connection"
3) In the dialog that follows, select your DataSource, and database, specify the security info, and press the "Test connection" button.
4) When the connection works, press "OK"
5) Highlight your database in the Server Explorer pane, and look at the Properties pane. A working example of the connection string will be shown, which you can copy and paste into your app or config file.