15,886,639 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by SAPTARSHI SENGUPTA (Top 11 by date)
SAPTARSHI SENGUPTA
1-Feb-16 15:00pm
View
yes because Some one is drop my table and delete data because my db user name pass is only known by me and i changed it regularly
SAPTARSHI SENGUPTA
1-Feb-16 14:58pm
View
My function is
private int ExecuteNonproc(string storedproc, string[] paraname, string[] paravalue)
{
try
{
int result = 0;
SqlConnection cn = new SqlConnection(cnn.DbConnectionString);
SqlCommand cmd = new SqlCommand(storedproc, cn);
cmd.CommandType = CommandType.StoredProcedure;
for (int i = 0; i < paraname.Length; i++)
{
cmd.Parameters.AddWithValue(paraname[i], paravalue[i]);
}
if (cn.State == ConnectionState.Open)
{
cn.Close();
}
cn.Open();
result = cmd.ExecuteNonQuery();
cn.Dispose();
cn.Close();
return result;
}
catch
{
throw;
}
}
and then
public int createAccount(AccountModel model)
{
try
{
string[] paraname = { "@Id", "@Name", "@Roll"};
string[] paravalue = { model.Id, model.Name, model.Roll };
return ExecuteNonproc("spp_add_student", paraname, paravalue);
}
catch
{
throw;
}
}
SAPTARSHI SENGUPTA
19-Aug-15 12:38pm
View
this is the sampel code first is the three function
SAPTARSHI SENGUPTA
19-Aug-15 12:37pm
View
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using Bioresonance.Models;
namespace Bioresonance.Class
{
public class adminDataLayer
{
connnection cnn = new connnection();
private DataSet Executeproc(string storedproc, string[] paraname,
string[] paravalue)
{
try
{
SqlDataAdapter da;
DataSet ds;
SqlConnection cn = new SqlConnection(cnn.DbConnectionString);
SqlCommand cmd = new SqlCommand(storedproc, cn);
cmd.CommandType = CommandType.StoredProcedure;
for (int i = 0; i < paraname.Length; i++)
{
cmd.Parameters.AddWithValue(paraname[i], paravalue[i]);
}
if (cn.State == ConnectionState.Open)
{
cn.Close();
}
da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds);
cn.Dispose();
cn.Close();
return ds;
}
catch
{
throw;
}
}
private int ExecuteNonproc(string storedproc, string[] paraname,
string[] paravalue)
{
try
{
int result = 0;
SqlConnection cn = new SqlConnection(cnn.DbConnectionString);
SqlCommand cmd = new SqlCommand(storedproc, cn);
cmd.CommandType = CommandType.StoredProcedure;
for (int i = 0; i < paraname.Length; i++)
{
cmd.Parameters.AddWithValue(paraname[i], paravalue[i]);
}
if (cn.State == ConnectionState.Open)
{
cn.Close();
}
cn.Open();
result = cmd.ExecuteNonQuery();
cn.Dispose();
cn.Close();
return result;
}
catch
{
throw;
}
}
public DataSet Inline_Process(String Query)
{
SqlConnection con = new SqlConnection(cnn.DbConnectionString);
SqlCommand cmd = new SqlCommand(Query, con);
con.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
da.Dispose();
con.Dispose();
return ds;
}
public DataSet getlogin(AccountModel model)
{
try
{
string[] paraname = { "@User_Name", "@password" };
string[] paravalue = { model.username, model.password };
return Executeproc("spp_getLogin", paraname, paravalue);
}
catch
{
throw;
}
}
public DataSet changePassword(AccountModel model)
{
try
{
string[] paraname = { "@User_Name", "@OldPassword",
"@NewPass1", "@NewPass2" };
string[] paravalue = { model.username, model.OldPassword,
model.Password1, model.Password2 };
return Executeproc("spp_changePassword", paraname, paravalue);
}
catch
{
throw;
}
}
public int updateHeading(string HeadingFor, string Heading)
{
try
{
string[] paraname = { "@Heading_For", "@Heading" };
string[] paravalue = { HeadingFor, Heading };
return ExecuteNonproc("spp_updateHeading", paraname,
paravalue);
}
catch
{
throw;
}
}
public int updatePage(PageModel model)
{
try
{
SAPTARSHI SENGUPTA
19-Aug-15 12:37pm
View
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using Bioresonance.Models;
namespace Bioresonance.Class
{
public class adminDataLayer
{
connnection cnn = new connnection();
private DataSet Executeproc(string storedproc, string[] paraname,
string[] paravalue)
{
try
{
SqlDataAdapter da;
DataSet ds;
SqlConnection cn = new SqlConnection(cnn.DbConnectionString);
SqlCommand cmd = new SqlCommand(storedproc, cn);
cmd.CommandType = CommandType.StoredProcedure;
for (int i = 0; i < paraname.Length; i++)
{
cmd.Parameters.AddWithValue(paraname[i], paravalue[i]);
}
if (cn.State == ConnectionState.Open)
{
cn.Close();
}
da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds);
cn.Dispose();
cn.Close();
return ds;
}
catch
{
throw;
}
}
private int ExecuteNonproc(string storedproc, string[] paraname,
string[] paravalue)
{
try
{
int result = 0;
SqlConnection cn = new SqlConnection(cnn.DbConnectionString);
SqlCommand cmd = new SqlCommand(storedproc, cn);
cmd.CommandType = CommandType.StoredProcedure;
for (int i = 0; i < paraname.Length; i++)
{
cmd.Parameters.AddWithValue(paraname[i], paravalue[i]);
}
if (cn.State == ConnectionState.Open)
{
cn.Close();
}
cn.Open();
result = cmd.ExecuteNonQuery();
cn.Dispose();
cn.Close();
return result;
}
catch
{
throw;
}
}
public DataSet Inline_Process(String Query)
{
SqlConnection con = new SqlConnection(cnn.DbConnectionString);
SqlCommand cmd = new SqlCommand(Query, con);
con.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
da.Dispose();
con.Dispose();
return ds;
}
public DataSet getlogin(AccountModel model)
{
try
{
string[] paraname = { "@User_Name", "@password" };
string[] paravalue = { model.username, model.password };
return Executeproc("spp_getLogin", paraname, paravalue);
}
catch
{
throw;
}
}
public DataSet changePassword(AccountModel model)
{
try
{
string[] paraname = { "@User_Name", "@OldPassword",
"@NewPass1", "@NewPass2" };
string[] paravalue = { model.username, model.OldPassword,
model.Password1, model.Password2 };
return Executeproc("spp_changePassword", paraname, paravalue);
}
catch
{
throw;
}
}
public int updateHeading(string HeadingFor, string Heading)
{
try
{
string[] paraname = { "@Heading_For", "@Heading" };
string[] paravalue = { HeadingFor, Heading };
return ExecuteNonproc("spp_updateHeading", paraname,
paravalue);
}
catch
{
throw;
}
}
public int updatePage(PageModel model)
{
try
{
SAPTARSHI SENGUPTA
19-Aug-15 12:37pm
View
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using Bioresonance.Models;
namespace Bioresonance.Class
{
public class adminDataLayer
{
connnection cnn = new connnection();
private DataSet Executeproc(string storedproc, string[] paraname,
string[] paravalue)
{
try
{
SqlDataAdapter da;
DataSet ds;
SqlConnection cn = new SqlConnection(cnn.DbConnectionString);
SqlCommand cmd = new SqlCommand(storedproc, cn);
cmd.CommandType = CommandType.StoredProcedure;
for (int i = 0; i < paraname.Length; i++)
{
cmd.Parameters.AddWithValue(paraname[i], paravalue[i]);
}
if (cn.State == ConnectionState.Open)
{
cn.Close();
}
da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds);
cn.Dispose();
cn.Close();
return ds;
}
catch
{
throw;
}
}
private int ExecuteNonproc(string storedproc, string[] paraname,
string[] paravalue)
{
try
{
int result = 0;
SqlConnection cn = new SqlConnection(cnn.DbConnectionString);
SqlCommand cmd = new SqlCommand(storedproc, cn);
cmd.CommandType = CommandType.StoredProcedure;
for (int i = 0; i < paraname.Length; i++)
{
cmd.Parameters.AddWithValue(paraname[i], paravalue[i]);
}
if (cn.State == ConnectionState.Open)
{
cn.Close();
}
cn.Open();
result = cmd.ExecuteNonQuery();
cn.Dispose();
cn.Close();
return result;
}
catch
{
throw;
}
}
public DataSet Inline_Process(String Query)
{
SqlConnection con = new SqlConnection(cnn.DbConnectionString);
SqlCommand cmd = new SqlCommand(Query, con);
con.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
da.Dispose();
con.Dispose();
return ds;
}
public DataSet getlogin(AccountModel model)
{
try
{
string[] paraname = { "@User_Name", "@password" };
string[] paravalue = { model.username, model.password };
return Executeproc("spp_getLogin", paraname, paravalue);
}
catch
{
throw;
}
}
public DataSet changePassword(AccountModel model)
{
try
{
string[] paraname = { "@User_Name", "@OldPassword",
"@NewPass1", "@NewPass2" };
string[] paravalue = { model.username, model.OldPassword,
model.Password1, model.Password2 };
return Executeproc("spp_changePassword", paraname, paravalue);
}
catch
{
throw;
}
}
public int updateHeading(string HeadingFor, string Heading)
{
try
{
string[] paraname = { "@Heading_For", "@Heading" };
string[] paravalue = { HeadingFor, Heading };
return ExecuteNonproc("spp_updateHeading", paraname,
paravalue);
}
catch
{
throw;
}
}
public int updatePage(PageModel model)
{
try
{
SAPTARSHI SENGUPTA
3-Jul-15 18:29pm
View
can you showing a screen shot demo that how to add umbraco cms in my asp.net c# site...
SAPTARSHI SENGUPTA
3-Jul-15 13:51pm
View
can you suggest me any simple asp.net c# cms
SAPTARSHI SENGUPTA
15-Jun-15 5:22am
View
yes it is sucessfull.but i want to know that is their any process to show message alert like window application (your trial is remaning 30 days).i want to show in asp.net
SAPTARSHI SENGUPTA
15-Jun-15 3:53am
View
thank you very much.sir.
is their any process to show message alert
SAPTARSHI SENGUPTA
14-Jun-15 12:57pm
View
sir i watch the tutorial but i was confused that how can i use this,
My project is a a medcine shop
here user entry the manufacture date and expiry date.Before 30 days of expiry date he wants to notification or watch in grid view that thoes records are red,plzz help me
Show More