Created
May 24, 2013 18:30
-
-
Save jbubriski/5645557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<ContactUsBizFormData> GetContactUsData() | |
{ | |
using (SqlConnection sqlconn = new SqlConnection(ConfigurationManager.ConnectionStrings["CMSConnectionString"].ConnectionString)) | |
{ | |
var sqlCommand = new SqlCommand(); | |
sqlCommand.Connection = sqlconn; | |
sqlconn.Open(); | |
var sqlReader = sqlCommand.ExecuteReader(); | |
var contactUsData = new List<ContactUsBizFormData>(); | |
while (sqlReader.Read()) | |
{ | |
var contactUsDataItem = new ContactUsBizFormData | |
{ | |
ContactUsID = int.Parse(sqlReader["ContactUsID"].ToString()), | |
FirstName = sqlReader[1].ToString() | |
}; | |
contactUsData.Add(contactUsDataItem); | |
} | |
sqlconn.Close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment