I have created database name Notes.Table name tbNotes. Column names are NotesID(int),
Notes(Varchar), Client(Varchar),Date(DateTime),Category(Varchar).
Here is my Code for webservices....
[WebMethod]
public int AddNotes(int NotesID, string Notes,string Client, string Date, string Category)
{
string strConn="Data Source=#####; Initial Catalog=Notes;uid=sa; pwd=####;";
SqlConnection cnn = new SqlConnection(strConn);
cnn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = cnn;
cmd.CommandText =
"insert into tbNotes(NotesID,Notes,Client,Data,Category)values (" + NotesID + ",'" + Notes + "','" + Client + "','" + Date + "', " + Category + ")";
int i = cmd.ExecuteNonQuery();
cnn.Close();
return i;
}
private void button1_Click(object sender, EventArgs e)
{
if (txtnotesid.Text == "" || txtnotes.Text == "" || txtclient.Text == "" || category.Text == "")
{
MessageBox.Show("Please Enter The Details");
}
else
{
notesapp.WebService1 obj = new notesapp.WebService1();
}