-
Imports System.Data.SqlClient
-
Namespace Accounts
-
Public Class NewAccount
-
Dim cmd As New SqlCommand
-
Dim c As New DatabaseConnection.DataBaseConnaction.ConnectionClass
-
Function CreateAccount(ByVal BankID As String, ByVal Account_TypeID As String, ByVal First_Name As String, ByVal Last_Name As String, ByVal Date_Birth As DateTime, ByVal Citizenship As String, ByVal Civil_Id As Integer, ByVal address As String, ByVal Father_Name As String, ByVal Profession As String, ByVal Description As String, ByVal Date_creation As DateTime, ByVal phoneNo As String, ByVal emailid As String, ByVal ext As String, ByVal CreatedBy As String, ByVal UserID As String)
-
Try
-
cmd.Parameters.Add("@BankID", SqlDbType.VarChar)
-
cmd.Parameters.Item("@BankID").Value = BankID
-
-
cmd.Parameters.Add("@Account_TypeID", SqlDbType.VarChar)
-
cmd.Parameters.Item("@Account_TypeID").Value = Account_TypeID
-
-
cmd.Parameters.Add("@First_Name", SqlDbType.VarChar)
-
cmd.Parameters.Item("@First_Name").Value = First_Name
-
-
cmd.Parameters.Add("@Last_Name", SqlDbType.VarChar)
-
cmd.Parameters.Item("@Last_Name").Value = Last_Name
-
-
cmd.Parameters.Add("@Date_Birth", SqlDbType.DateTime)
-
cmd.Parameters.Item("@Date_Birth").Value = Date_Birth
-
-
cmd.Parameters.Add("@Citizenship", SqlDbType.VarChar)
-
cmd.Parameters.Item("@Citizenship").Value = Citizenship
-
-
cmd.Parameters.Add("@Civil_Id", SqlDbType.Int)
-
cmd.Parameters.Item("@Civil_Id").Value = Civil_Id
-
-
cmd.Parameters.Add("@Address", SqlDbType.VarChar)
-
cmd.Parameters.Item("@Address").Value = address
-
-
cmd.Parameters.Add("@Father_Name", SqlDbType.VarChar)
-
cmd.Parameters.Item("@Father_Name").Value = Father_Name
-
-
cmd.Parameters.Add("@Profession", SqlDbType.VarChar)
-
cmd.Parameters.Item("@Profession").Value = Profession
-
-
cmd.Parameters.Add("@phoneNo", SqlDbType.VarChar)
-
cmd.Parameters.Item("@phoneNo").Value = phoneNo
-
-
cmd.Parameters.Add("@emailid", SqlDbType.VarChar)
-
cmd.Parameters.Item("@emailid").Value = emailid
-
-
cmd.Parameters.Add("@Ext", SqlDbType.VarChar)
-
cmd.Parameters.Item("@Ext").Value = ext
-
-
cmd.Parameters.Add("@Description", SqlDbType.VarChar)
-
cmd.Parameters.Item("@Description").Value = Description
-
-
cmd.Parameters.Add("@Date_creation", SqlDbType.DateTime)
-
cmd.Parameters.Item("@Date_creation").Value = Date.Now
-
-
cmd.Parameters.Add("@CreatedBy", SqlDbType.VarChar)
-
cmd.Parameters.Item("@CreatedBy").Value = CreatedBy
-
-
cmd.Parameters.Add("@UserID", SqlDbType.VarChar)
-
cmd.Parameters.Item("@UserID").Value = UserID
-
-
cmd.CommandType = CommandType.StoredProcedure
-
cmd.CommandText = "Execute_Account2"
-
-
Dim QueryExecute As New DatabaseConnection.DataBaseConnaction.ConnectionClass
-
QueryExecute.ExecuteNonquery(cmd)
-
Return "New Account has been successully added"
-
Catch ex As Exception
-
-
Return "Error"
-
-
End Try
-
End Function
-
-
End Class
-
-
End Namespace
-
I am geeting the Error pls any one sole this
4 1523 numberwhun 3,509
Recognized Expert Moderator Specialist
Next time....
1. Please use code tags.
2. Please post questions in their appropriate forum, and not the introductions forum.
Regards,
Jeff Moderator
ALTER PROCEDURE [dbo].[InsertAccount]
@BankID AS VARCHAR(500) ,
@Account_TypeID AS VARCHAR(500) ,
@First_Name AS VARCHAR(500) ,
@Last_Name AS VARCHAR(500) ,
@Date_Birth AS DATETIME ,
@Citizenship AS VARCHAR(500) ,
@Civil_Id AS BIGINT ,
@Address AS VARCHAR(500) ,
@Father_Name AS VARCHAR(500) ,
@Profession AS VARCHAR(500) ,
@phoneNo varchar(500) ,
@emailid varchar(500) ,
@Ext varchar(50) ,
@Description AS VARCHAR(500) ,
@Date_creation AS DATETIME ,
@CreatedBy AS VARCHAR(500) ,
@UserID AS VARCHAR(500)
AS
BEGIN
------------Account Number genaration-----------
DECLARE @Account_Number AS VARCHAR(500) ;
-- DECLARE @AccountTypeID AS VARCHAR(500) ;
---- SELECT @Location=BankL ocation FROM Bank WHERE BankID=@BankID
---- SELECT @AccountTypeID= AccountTypeID FROM AccountTypes WHERE AccountTypeID=@ Account_TypeID
IF @Account_TypeID ='SB'
BEGIN
IF @BankID='NBKFAR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '101' AND '75000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =101
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKMIR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '75001' AND '150000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =75001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '150001' AND '225000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =150001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 02'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '225001' AND '300000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =225001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE
BEGIN
RAISERROR('Inva lid Information',18 ,3)
END
END
ELSE IF @Account_TypeID ='AC'
BEGIN
IF @BankID='NBKFAR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '2000001' AND '2075000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =2000001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKMIR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '2075001' AND '2150000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =2075001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '2150001' AND '2225000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =2150001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 02'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '2225001' AND '2300000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =2225001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE
BEGIN
RAISERROR('Inva lid Information',18 ,3)
END
END
ELSE IF @Account_TypeID ='FIX'
BEGIN
IF @BankID='NBKFAR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '5000001' AND '5075000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =5000001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKMIR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '5075001' AND '5150000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =5075001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '5150001' AND '5225000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =5150001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 02'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '5225001' AND '5300000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =5225001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE
BEGIN
RAISERROR('Inva lid Information',18 ,3)
END
END
INSERT INTO AccountDetails
(
Account_Number ,
BankID ,
Account_TypeID ,
First_Name ,
Last_Name ,
Date_Birth ,
Citizenship ,
Civil_Id ,
Address ,
Father_Name ,
Profession ,
Date_creation ,
phoneNo ,
emailid ,
Ext ,
Description ,
CreatedBy ,
UserID
)
VALUES
(
@Account_Number ,
@BankID ,
@Account_TypeID ,
@First_Name ,
@Last_Name ,
@Date_Birth ,
@Citizenship ,
@Civil_Id ,
@Address ,
@Father_Name ,
@Profession ,
@Date_creation ,
@phoneNo ,
@emailid ,
@Ext ,
@Description ,
@CreatedBy ,
@UserID
)
END
Dear All
i'm using this code to insert a record, but wen i'm using wrong data that time i'm not able to retrivew Error msg please replay me.
nazim
- ALTER PROCEDURE [dbo].[InsertAccount]
@BankID AS VARCHAR(500) ,
@Account_TypeID AS VARCHAR(500) ,
@First_Name AS VARCHAR(500) ,
@Last_Name AS VARCHAR(500) ,
@Date_Birth AS DATETIME ,
@Citizenship AS VARCHAR(500) ,
@Civil_Id AS BIGINT ,
@Address AS VARCHAR(500) ,
@Father_Name AS VARCHAR(500) ,
@Profession AS VARCHAR(500) ,
@phoneNo varchar(500) ,
@emailid varchar(500) ,
@Ext varchar(50) ,
@Description AS VARCHAR(500) ,
@Date_creation AS DATETIME ,
@CreatedBy AS VARCHAR(500) ,
@UserID AS VARCHAR(500)
AS
BEGIN
------------Account Number genaration-----------
DECLARE @Account_Number AS VARCHAR(500) ;
-- DECLARE @AccountTypeID AS VARCHAR(500) ;
---- SELECT @Location=BankL ocation FROM Bank WHERE BankID=@BankID
---- SELECT @AccountTypeID= AccountTypeID FROM AccountTypes WHERE AccountTypeID=@ Account_TypeID
IF @Account_TypeID ='SB'
BEGIN
IF @BankID='NBKFAR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '101' AND '75000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =101
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKMIR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '75001' AND '150000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =75001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '150001' AND '225000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =150001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 02'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '225001' AND '300000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =225001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE
BEGIN
RAISERROR('Inva lid Information',18 ,3)
END
END
ELSE IF @Account_TypeID ='AC'
BEGIN
IF @BankID='NBKFAR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '2000001' AND '2075000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =2000001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKMIR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '2075001' AND '2150000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =2075001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '2150001' AND '2225000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =2150001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 02'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '2225001' AND '2300000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =2225001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE
BEGIN
RAISERROR('Inva lid Information',18 ,3)
END
END
ELSE IF @Account_TypeID ='FIX'
BEGIN
IF @BankID='NBKFAR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '5000001' AND '5075000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =5000001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKMIR 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '5075001' AND '5150000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =5075001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 01'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '5150001' AND '5225000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =5150001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE IF @BankID='NBKSRK 02'
BEGIN
SELECT @Account_Number =MAX(Account_Nu mber) FROM AccountDetails WHERE Account_Number BETWEEN '5225001' AND '5300000'
IF @Account_Number IS NULL
BEGIN
SELECT @Account_Number =5225001
END
ELSE
BEGIN
SELECT @Account_Number =@Account_Numbe r+1
END
END
ELSE
BEGIN
RAISERROR('Inva lid Information',18 ,3)
END
END
INSERT INTO AccountDetails
(
Account_Number ,
BankID ,
Account_TypeID ,
First_Name ,
Last_Name ,
Date_Birth ,
Citizenship ,
Civil_Id ,
Address ,
Father_Name ,
Profession ,
Date_creation ,
phoneNo ,
emailid ,
Ext ,
Description ,
CreatedBy ,
UserID
)
VALUES
(
@Account_Number ,
@BankID ,
@Account_TypeID ,
@First_Name ,
@Last_Name ,
@Date_Birth ,
@Citizenship ,
@Civil_Id ,
@Address ,
@Father_Name ,
@Profession ,
@Date_creation ,
@phoneNo ,
@emailid ,
@Ext ,
@Description ,
@CreatedBy ,
@UserID
)
END
Dear All
i'm using this code to insert a record, but wen i'm using wrong data that time i'm not able to retrivew Error msg please replay me.
nazim[/quote] Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Sharone Shani |
last post by:
Hi John, thanks for your replay.
What I'm trying to do is as follows:
We are hosting a server, which is used by our clients. We
have a printing object written in Visual Basic.NET. I
want to use this object to allow our clients to print
some of our web pages, using this object, in their own
local printer. In other words, I need to somehow...
|
by: zak |
last post by:
I have some testing to do and I need to put a whole set of data in I want to
Record and replay in a loop keystrokes.
An idea
|
by: newcomer |
last post by:
I have traced action in XML. Now I would like to replay that. How could I
do that based on this XML trace? I am using soap:tcp between client and
server.
thanks,
|
by: Baheri |
last post by:
Does any one have a sample on how can replay attacks be prevented in a
webservice?
|
by: neonspark |
last post by:
I'm buidling some simple macro functionality for my app so the users can record a sequence of keyboard inputs and replay them reliably via some menu.
Originally, I used:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
To map "Keys" objects to their string constant, and stored them on a string Queue as they were...
| |
by: Derrick |
last post by:
Can anyone suggest a tool (if one exists) to capture IIS traffic and be able
to "replay" that traffic?
We are in the process of moving from sql2k to sql2005. What I would like to
do is take a snapshot of the sql2k db, start iis logging, and let the prod
site run for a few hours capturing all that traffic, then take another snap
of the...
|
by: phanimadhav |
last post by:
Actually i am new one of this ASP.NET.i have have one problem with session_end() in Global.aspx.when this session_end() is faired. I call the session.abandon() method.but my requirement is whenever i call the signout() method that time this session_end() is faired.please send ur replay as early as possible.if any mistakes in my query sorry don't...
|
by: Lew |
last post by:
Hi,
I'm looking for a tool that can capture all the sql transactions for a
period of time (24 hours or so ) from our production server and replay
it exactly as entered on our performance tuning server. Does anyone
know of such a tool from IBM or another vendor?
Thanks.
Lew
|
by: Gomi |
last post by:
Hi guys I'm new to C++ Programming and I am having trouble in making my Guessing game code replay. I am suppose to give the user that is playing my game the opportunity to play again with options of 'Yes' and 'No' and if Yes then the game starts up again and if No then the game tells the user bye and quits.
"Do you want to play again? (y/n)"...
|
by: hany1002 |
last post by:
I design stores database and I have a problem
I maked Invoices for the purchase and sale,
I need to transfer Items between Branches in my store access database ?
Any Ideas
thank you
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |