1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
SqlConnection conn = new SqlConnection(conStr); SqlCommand cmd = new SqlCommand("sp_getdata", conn); cmd.Parameters.Add("@userIndex", SqlDbType.Int).Value = MemberNo; cmd.CommandType = CommandType.StoredProcedure; conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { Fee = Convert.ToInt32(reader["Fee"].ToString()); } conn.Close(); |