salamo 3alycom
InternalMsg is atable that contain one field its type is UniqueIdentifier
but userid variable in my system is GUID Variable
so when i try to insert the userid into InternalMsg table i receive error about
converting from Guid to UniqueIdentifier
here is my code
''''''''''''''''''''''''''''''''''''''''''''''
.
.
Conn.Open();
string SQL = "insert into InternalMsg(?)";
SqlCommand cmd = new SqlCommand(Sql, Conn);
SqlParameter Param;
Param = cmd.Parameters.Add("@FromUser", SqlDbType.UniqueIdentifier);
Param.Value = UserId;
cmd.ExecuteNonQuery();