Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
4
Answers
ERROR: Method name expected
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Sousa Pambo
7y
214
1
Reply
Hi, i get this error ,Method name expected, when I write this code, please help
public string MonthP(string student_id, int y, string mth)
{
string sql = "Select sitS from Sit where student_id='" + id + "' and years='" + (y).ToString() + "'";
using (SqlConnection cn = new SqlConnection(con.stringConex()))
{
try
{
cn.Open();
using (SqlCommand cm = new SqlCommand(sql, cn))
{
using (SqlDataReader rd = cm.ExecuteReader())
{
if (rd.Read())
{
return
rd["sitS "]
(Convert.ToInt32(mth) - 1);
// Error on this line
}
else
{
return "-1";
}
}
}
}
catch (Exception ex)
{
return "-1";
}
}
}
Thanks!
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
Problem in asp.net application while running on liveserver
Do i need partial view compulsary to add devExpress Gridview