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
Kasuni Abegunawardana
NA
211
125.6k
How to add a message box into a class in asp.net web forms
Nov 21 2017 9:26 AM
I have created a class and when i'm going to add a message box it show me errors on "Response". How can fix it.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.UI;
namespace Food_Calorie_Calculator__Final_Project.Consultant
{
public class ConsultantRegistraion
{
public void Con_Reg()
{
string strcon = ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString;
SqlConnection con = new SqlConnection(strcon);
try
{
con.Open();
SqlCommand cmd = new SqlCommand("insert into AdminConsultantConfirmation_tb() values()", con);
cmd.Parameters.AddWithValue("@", );
cmd.Parameters.AddWithValue("@", );
cmd.Parameters.AddWithValue("@", );
cmd.Parameters.AddWithValue("@", );
cmd.Parameters.AddWithValue("@", );
cmd.Parameters.AddWithValue("@", );
cmd.Parameters.AddWithValue("@", );
cmd.Parameters.AddWithValue("@", );
cmd.Parameters.AddWithValue("@", );
cmd.Parameters.AddWithValue("@", );
cmd.Parameters.AddWithValue("@", );
cmd.Parameters.AddWithValue("@", );
SqlDataAdapter da = new SqlDataAdapter(cmd);
cmd.ExecuteNonQuery();
Response.write("Data is not inserted");
}
catch (Exception ex)
{
Response.write("Data is not inserted");
con.Close();
}
finally
{
}
}
}
}
Reply
Answers (
1
)
Accounts Switching with Gridview
How to call a class into aspx.cs