Click here to Skip to main content
15,915,693 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionaccented characters in email addresses Pin
l a u r e n14-Jun-11 9:02
l a u r e n14-Jun-11 9:02 
AnswerRe: accented characters in email addresses Pin
GenJerDan14-Jun-11 11:16
GenJerDan14-Jun-11 11:16 
GeneralRe: accented characters in email addresses Pin
l a u r e n14-Jun-11 12:50
l a u r e n14-Jun-11 12:50 
GeneralRe: accented characters in email addresses Pin
GenJerDan18-Jun-11 2:17
GenJerDan18-Jun-11 2:17 
QuestionDynamic grid Pin
C#Coudou13-Jun-11 23:20
C#Coudou13-Jun-11 23:20 
AnswerRe: Dynamic grid Pin
Anurag Gandhi14-Jun-11 0:18
professionalAnurag Gandhi14-Jun-11 0:18 
GeneralRe: Dynamic grid Pin
C#Coudou14-Jun-11 13:51
C#Coudou14-Jun-11 13:51 
QuestionWeb Service Pin
Member 322226413-Jun-11 15:05
Member 322226413-Jun-11 15:05 
Hi,
I need to create a business layer and Service layer.The service layer must have a webservice that has common web methods for
1)Insert
2)Update
3)Select
4)Delete

This is My dbAccess Class:: 
 
using System; 
using System.Collections.Generic; 
using System.Web; 
using System.Web.Configuration; 
using System.Data.SqlClient; 
using System.Data; 
using System.Web.Services; 
 
namespace Assign3_PRS 
{ 
    public class dbAccess 
    { 
        public string connectionString = @"Data Source=.\CARECENTERMD; Initial Catalog=Automation; Integrated Security=true"; 
        SqlConnection connection; 
        SqlCommand command; 
        SqlDataAdapter dataAdapter; 
        DataSet dataset; 
        DataTable datatable; 
         
         public dbAccess() 
        { 
           
        } 
 
        [WebMethod()] 
         public string Login_Check(Login login) 
         { 
             string role = string.Empty; 
 
             connection = new SqlConnection(connectionString); 
             command = new SqlCommand("CHECK_USER_PASSWD", connection); 
             command.CommandType = CommandType.StoredProcedure; 
             command.Parameters.Add("@UserName", SqlDbType.VarChar).Value = login.username; 
             command.Parameters.Add("@passWord", SqlDbType.VarChar).Value = login.password; 
             dataAdapter = new SqlDataAdapter(command); 
             datatable = new DataTable(); 
             dataAdapter.Fill(datatable); 
             if (datatable.Rows.Count > 0) 
             { 
                 role = datatable.Rows[0]["Roles"].ToString(); 
             } 
             else 
             { 
                 string NotValidUser = "NotValidUser"; 
                 return NotValidUser; 
             } 
             return role; 
         } 
 
         [WebMethod()] 
        public int Insert(Patient patient) 
        { 
            connection = new SqlConnection(connectionString); 
            connection.Open(); 
            command = new SqlCommand("SAVING_PAT_DETAILS", connection); 
            command.CommandType = CommandType.StoredProcedure; 
            try 
            { 
                command.Parameters.AddWithValue("@ID", patient.Id); 
                command.Parameters.AddWithValue("@NAME", patient.Name); 
                command.Parameters.AddWithValue("@SEX", patient.Sex); 
                command.Parameters.AddWithValue("@PROBLEM", patient.Problem); 
                command.Parameters.AddWithValue("@ADDRESS", patient.Address); 
                command.Parameters.AddWithValue("@PHONE", patient.Phone); 
                command.Parameters.AddWithValue("@PROBLEM", patient.Problem); 
                command.Parameters.AddWithValue("@COMMENTS", patient.Comments); 
 
                return command.ExecuteNonQuery(); 
            } 
            catch (Exception ex) 
            { 
                throw ex; 
            } 
            finally 
            { 
                command.Dispose(); 
                connection.Close(); 
                connection.Dispose(); 
            } 
        } 
 
         [WebMethod()] 
        public int Update(Patient patient) 
        { 
            connection = new SqlConnection(connectionString); 
            connection.Open(); 
            command = new SqlCommand("UPDATING_PAT_DETAILS", connection); 
            command.CommandType = CommandType.StoredProcedure; 
            try 
            { 
                command.Parameters.AddWithValue("@ID", patient.Id); 
                command.Parameters.AddWithValue("@NAME", patient.Name); 
                command.Parameters.AddWithValue("@SEX", patient.Sex); 
                command.Parameters.AddWithValue("@PROBLEM", patient.Problem); 
                command.Parameters.AddWithValue("@ADDRESS", patient.Address); 
                command.Parameters.AddWithValue("@PHONE", patient.Phone); 
                command.Parameters.AddWithValue("@PROBLEM", patient.Problem); 
                command.Parameters.AddWithValue("@COMMENTS", patient.Comments); 
 
                return command.ExecuteNonQuery(); 
            } 
            catch (Exception ex) 
            { 
                throw ex; 
            } 
            finally 
            { 
                command.Dispose(); 
                connection.Close(); 
                connection.Dispose(); 


Above code i had mentioned SP NAME,parameters etc.The parameters must be common based ie we can pass any number of parameters and mention the SP name as desired.I have no idea how to do.Please help

how to write the business layer and consume this webservice
AnswerRe: Web Service Pin
Ra-one13-Jun-11 20:16
Ra-one13-Jun-11 20:16 
Questionvery urgent dynamically change content page in menu click event from master page Pin
lakshmisindhu13-Jun-11 4:58
lakshmisindhu13-Jun-11 4:58 
AnswerRe: very urgent dynamically change content page in menu click event from master page Pin
Richard MacCutchan13-Jun-11 6:08
mveRichard MacCutchan13-Jun-11 6:08 
QuestionSocial Networking Component Pin
Jassim Rahma12-Jun-11 4:21
Jassim Rahma12-Jun-11 4:21 
AnswerRe: Social Networking Component Pin
Shahriar Iqbal Chowdhury/Galib12-Jun-11 5:50
professionalShahriar Iqbal Chowdhury/Galib12-Jun-11 5:50 
AnswerRe: Social Networking Component Pin
Atulkryadav16-Jun-11 8:06
Atulkryadav16-Jun-11 8:06 
QuestionMessenger in ASP.NET Pin
Member 322226411-Jun-11 16:49
Member 322226411-Jun-11 16:49 
AnswerRe: Messenger in ASP.NET PinPopular
Richard Andrew x6411-Jun-11 17:38
professionalRichard Andrew x6411-Jun-11 17:38 
AnswerRe: Messenger in ASP.NET Pin
Richard MacCutchan11-Jun-11 21:56
mveRichard MacCutchan11-Jun-11 21:56 
GeneralRe: Messenger in ASP.NET Pin
AspDotNetDev11-Jun-11 22:41
protectorAspDotNetDev11-Jun-11 22:41 
GeneralRe: Messenger in ASP.NET Pin
Lutosław12-Jun-11 22:57
Lutosław12-Jun-11 22:57 
AnswerRe: Messenger in ASP.NET Pin
Lutosław12-Jun-11 22:54
Lutosław12-Jun-11 22:54 
QuestionMessenger in .NET Pin
Member 322226411-Jun-11 3:25
Member 322226411-Jun-11 3:25 
AnswerRe: Messenger in .NET Pin
gavindon11-Jun-11 3:31
gavindon11-Jun-11 3:31 
GeneralRe: Messenger in .NET Pin
Member 322226411-Jun-11 3:35
Member 322226411-Jun-11 3:35 
GeneralRe: Messenger in .NET Pin
Pete O'Hanlon11-Jun-11 4:31
mvePete O'Hanlon11-Jun-11 4:31 
GeneralRe: Messenger in .NET Pin
gavindon11-Jun-11 4:48
gavindon11-Jun-11 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.