Please tell me how to Insert Web Interface records to SQL database table on Button click
I have several records for approving payment
and these records needs to be inserted into a table Payment List
(which is already created) and when i click confirm payment button the records need to be inserted to the payment list table and payment id is generated automatically and the table column Agency approval has to get a boolean value 1 if approved
Please suggest
Thanks,
George
3 3639
George,
OK, so what do you have so far? There is a simple tutorial in the ASP Articles section on how to insert records into a db. Let me know if this doesn't answer all of your questions. I'm willing to help, but if you would like one of our experts to do the job for you, it would be better to post in the jobs section.
Jared
Thanks for your reply jhardman,
I shall look into the articles too now.
Here is where i am right now
I am using the following codes for inserting records but it shows errors...please help -
//---- CS file/Code behind ---
-
-
protected void ReviewSelectionGDInsert_ItemCommand(object sender, DetailsViewCommandEventArgs e)
-
{
-
-
if (e.CommandName.Equals("Insert"))
-
{
-
-
ReviewSelectionGD.Insert();
-
-
}
-
-
}
-
-
protected void ComfPaymBRM_Click(object sender,EventArgs e)
-
{
-
-
string SSN = ((TextBox)ReviewSelectionGD.FindControl("SSN")).Text;
-
string JC_ID = ((TextBox)ReviewSelectionGD.FindControl("JC_ID")).Text;
-
-
string AGENCY_ID = ((TextBox)ReviewSelectionGD.FindControl("AGENCY_ID")).Text;
-
string Agency_approval = ((TextBox)ReviewSelectionGD.FindControl("Agency_approval")).Text;
-
-
string Agency_approval_date = ((DropDownList)ReviewSelectionGD.FindControl("Agency_approval_date")).Text;
-
e.InputParameters.Add("SSN", "");
-
-
e.InputParameters.Add("JC_ID", "");
-
e.InputParameters.Add("AGENCY_ID", "");
-
-
e.InputParameters.Add("Agency_approval", 1);e.InputParameters.Add("Agency_approval_date", getdate());
-
-
}
-
-
protected void ReviewSelectionGD_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
-
{
-
-
if (e.Exception != null)
-
{
-
-
DivResult.Visible = true;
-
}
-
-
else
-
-
{
-
-
// TODO
-
-
}
-
}
-
-
//BLL/DAL
-
-
public static int InsertPayment(
-
int SSN,
-
-
int JC_ID,
-
int AGENCY_ID,
-
-
int Agency_approval,DateTime Agency_approval_date
-
)
-
{
-
int rowsAffected = 0;using (SqlConnection connection = ConnectionManager.GetFinanceDBConnection())
-
{
-
-
SqlCommand command = new SqlCommand("InsertPaymentList", connection);
-
command.CommandType = CommandType.StoredProcedure;
-
-
command.Parameters.Add("@SSN", SqlDbType.VarChar).Value = SSN;
-
-
command.Parameters.Add("@JC_ID", SqlDbType.VarChar).Value = JC_ID;
-
command.Parameters.Add("@AGENCY_ID", SqlDbType.VarChar).Value = AGENCY_ID;
-
-
command.Parameters.Add("@Agency_approval", SqlDbType.VarChar).Value = Agency_approval;command.Parameters.Add("@Agency_approval_date", SqlDbType.datetime).Value = Agency_approval_date;
-
-
rowsAffected = command.ExecuteNonQuery();
-
-
}
-
-
return rowsAffected;
-
}
-
-
//stored procedure
-
-
ALTER PROCEDURE [dbo].[InsertPaymentList](
-
-
@SSN VARCHAR(50),
-
@JC_ID int ,
-
-
@AGENCY_ID VARCHAR(50),
-
-
@Agency_approval int,
-
-
@Agency_approval_date datetime)
-
-
AS
-
-
INSERT INTO Payment_LIST_AIMS
-
(SSN,JC_ID,AGENCY_ID,Agency_approval,Agency_approval_date)
-
-
VALUES
-
-
(@SSN,@JC_ID,@AGENCY_ID,@Agency_approval,@Agency_approval_date)
-
-
SET @SSN = SCOPE_IDENTITY()
-
[Edit Tags]
George,
This doesn't look like ASP classic. Is this ASP.NET? What language are you using?
Jared
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Sans Spam |
last post by:
Greetings! I have a table that contains all of the function
permissions within a given application. These functions are different
sections of a site and each has its own permissions (READ, WRITE,...
|
by: Tom Gao |
last post by:
I have a problem. The project that I'm working on requires me to duplicate
records. As in a series of records are entered into the system the user then
click on a button to make these as...
|
by: Abareblue |
last post by:
I have no clue on how to insert a record into access. here is the whole
thing
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
|
by: User |
last post by:
Hi !
I have a sql insert function with a buttonin my page, and when i click on
refresh button of IE. When i click my button, i have a new records but after
when i click on the refresh button of IE...
|
by: hellyna |
last post by:
How to insert radiobutton value into the mysql?
This is addrecordfrom.php
<form name="addsummonrecord" method="post" action="addrecordprocess.php" id="signup" onSubmit="return...
|
by: Christopher Lusardi |
last post by:
How can I fix this? When I do the below I get the error message:
"Cannot insert explict value for identity column in table
'Employees' when IDENTITY_INSERT is set to OFF."
To get this message,...
|
by: Ian Davies |
last post by:
Hello
Needing help with a suitable solution.
I have extracted records into a table under three columns 'category',
'comment' and share (the category column also holds the index no of the
record...
|
by: Steven Blair |
last post by:
Hi,
Would be grateful if anyone with a high understanding of the
SqlDataSource and FormView could have a look at my example and my
problems.
This has really been puzzling me for some time, and...
|
by: BenRatcliffe |
last post by:
Hi there,
I was wondering if anyone could help me. I have a comlpex database with a number of forms that have data entered on them and then saved into the correct table etc. In this instance I am...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |