Hi guys i have windows form application in this form i need to show date of server
not date of client so that i write following function
stored procedure
create proc datetoday1asselect getdate()as datetoday
function in c#
public string GetDateProcesses(string ConnectionString){SqlConnection con = new SqlConnection(ConnectionString);SqlCommand cmd = new SqlCommand();cmd.Connection = con;cmd.CommandType = CommandType.StoredProcedure;cmd.CommandText = "datetoday1";con.Open();string getdate=Convert.ToString(cmd.ExecuteNonQuery());con.Close();return getdate;}
in interface
but it return -1 not date of server what is wrong in my code
and what modification in code to return true result