DataSet ds;
Customer test = new Customer();
ds = new DataSet();
using (SqlConnection conn = Deck.Core.Database.NewConnection())
{
using (SqlCommand cmd = conn.CreateCommand())
{
SqlDataAdapter myAdapter = new SqlDataAdapter();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "SearchLastName";
cmd.Parameters.Add("@name", SqlDbType.NVarChar).Value = customerName;
conn.Open();
try
{
myAdapter.SelectCommand = cmd;
myAdapter.Fill(ds);
foreach (DataRow row in ds.Tables[0].Rows)
{
//test.EmailAddress = row[0].ToString();
//test.FirstName = row[1].ToString();
//test.Id = row[2].ToString();
//test.LastName = row[3].ToString();
//test.MiddleName = row[4].ToString();
//test.NamePrefix = row[5].ToString();
//test.AlternatePhoneNumber = row[6].ToString();
//test.PrimaryPhoneNumber = row[7].ToString();
}
}
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.