这是我的代码。
/// <summary>
/// Method calls stored procedure and fills DataSet of contacts associated with Lead
/// </summary>
/// <param name="leadID">The ID associated with a Lead</param>
/// <returns>contacts list as DataSet</returns>
public static DataSet GetContactResultSetByLead(int leadID)
{
SqlCommand Sqlmd = new SqlCommand("dbo.proc_contact");
Sqlmd.CommandType = CommandType.StoredProcedure;
Sqlmd.Parameters.Add("@LeadInfoID", SqlDbType.Int).Value = leadID;
Sqlmd.Connection = m_ConStr;
SqlDataAdapter da = new SqlDataAdapter(Sqlmd);
DataSet data = new DataSet();
try
{
da.Fill(data);
}
finally
{
m_ConStr.Close();
}
return data;
}