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
Avuya Mxoli
NA
236
208.9k
use of unassigned local variable aGame
Oct 10 2011 6:30 AM
Hi,
Can anyone see what is missing here?thanks
using (SqlConnection conn = new SqlConnection(ConnString))
{
SqlCommand cmd = new SqlCommand("GetGameForCountry", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Country", match);
Game aGame;
try
{
conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
aGame = new Game(reader["ID"].ToString(), reader["Location"].ToString(), reader["DateTime"].ToString());
}
reader.Close();
}
catch
{
}
return aGame;
Reply
Answers (
2
)
Combobox does not display selected item
How to record time every login in administrator or a user account?