Hell to every body on Vbforums,
By using Follwoing code i tried to insert data in database in silverlight
Code:Service1Client webservice = new Service1Client(); //ServiceReference1Client webservice = new (); bool b; b = webservice.InsertVoteAsync ("Abc", DateTime.Now.Date);
and the service code is
but gives me these errorsCode:[OperationContract] public bool InsertVote1(String vote, DateTime dt) { bool Inserted = false; Conn = new SqlConnection("Data Source=xyz-PC;Initial Catalog=Voting;User Id=sa;Password=sa;Integrated Security=SSPI"); Cmd = new SqlCommand(); Conn.Open(); Cmd.Connection = Conn; Cmd.CommandText = "insert into votes values(vote,dt)" ; int ins = Cmd.ExecuteNonQuery(); if (ins > 0) { Inserted = true; } Conn.Close(); return Inserted; }
Error 1 The best overloaded method match for 'VotingPanel.ServiceReference1.Service1Client.InsertVoteAsync(System.DateTime, string)' has some invalid arguments ........................
Error 2 Argument '1': cannot convert from 'string' to 'System.DateTime' ...............................
Error 3 Argument '2': cannot convert from 'System.DateTime' to 'string'
any one can help me


Reply With Quote