TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chris liatsos
NA
12
519
executing stored procedure in c# bot application error
Nov 21 2018 4:17 AM
public async Task<DataTable> MessageReceivedNearestMuseums(string lat, string lng)
{
SqlConnection cnn = new SqlConnection("Data Source=CHRISTOS\\SQLEXPRESS;Initial Catalog=GuideDB;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataTable dt = new DataTable();
cnn.Open();
cmd = new SqlCommand("get_nearest_Restaurants", cnn);
cmd.Parameters.Add(new SqlParameter("@lat", lat));
cmd.Parameters.Add(new SqlParameter("@lng", lng));
cmd.CommandType = CommandType.StoredProcedure;
da.SelectCommand = cmd;
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
String mes = "Nearest Museum ID: " + dr[1].ToString() + "\nName:" + dr[2].ToString() + "\nCity: " + dr[3].ToString() + "\nLocation: " + dr[4].ToString();
await context.PostAsync(mes);
}
dr.Read();
cnn.Close();
context.Wait(MessageReceivedNearestMuseums);
Reply
Answers (
4
)
Query to get who had more than one password.
Need to performance test a database design