String Manipulation With Web Form Query
Feb 24, 2006
I'm trying to look up customer records by e-mail domain by using a text box on a Web form. So if I want to look for all my customers that have an aol e-mail domain, I would type aol.com in the text box and the sub routine would know to count 7 characters from the right and through those characters into maybe a parameter query. I'm having problems passing this in. I can count the characters properly by using:
dim strText = MyTextBox.Text
dim intLength = strText.Length
but having problems starting here......
MyCommand.SelectCommand.Parameters("@email").Value = MyTextBox.Text
..............
but how would I ultimately feed this into my sql satement? Select * from Customers Where email = right(@email,intLength)
Help appreciated.
Frank
View 1 Replies
ADVERTISEMENT
Sep 11, 2006
Hello All,
I'm a non-programmer and an SQL newbie. I'm trying to create a printer usage report using LogParser and SQL database. I managed to export data from the print server's event log into a table in an SQL2005 database.
There are 3 main columns in the table (PrintJob) - Server (the print server name), TimeWritten (timestamp of each print job), String (eventlog message containing all the info I need). My problem is I need to split the String column which is a varchar(255) delimited by | (pipe). Example:
2|Microsoft Word - ราย�ารรับ.doc|Sukanlaya|HMb1_SD_LJ2420|IP_192.10.1.53|82720|1
The first value is the job number, which I don't need. The second value is the printed document name. The third value is the owner of the printed document. The fourth value is the printer name. The fifth value is the printer port, which I don't need. The sixth value is the size in bytes of the printed document, which I don't need. The seventh value is the number of page(s) printed.
How I can copy data in this table (PrintJob) into another table (PrinterUsage) and split the String column into 4 columns (Document, Owner, Printer, Pages) along with the Server and TimeWritten columns in the destination table?
In Excel, I would use combination of FIND(text_to_be_found, within_text, start_num) and MID(text, start_num, num_char). But CHARINDEX() in T-SQL only starts from the beginning of the string, right? I've been looking at some of the user-defind-function's and I can't find anything like Excel's FIND().
Or if anyone can think of a better "native" way to do this in T-SQL, I've be very grateful for the help or suggestion.
Thanks a bunch in advance,
Chutikorn
View 2 Replies
View Related
Dec 25, 2007
Hi,
I got a problem.
I installed Microsoft SQL Server Management Studio Express 2005 version.
And I created a Compact database.
I created an connection in SSMSE to connect the database and opened a query form.
then, i run the following sql:
Select * from Table1
It returned 3 records to me.
After that, I used program to insert record into this table.
Then i ran this sql again, it still show me 3 records.
I closed the query form, and re-created a new query form, then run the sql, it returned 4 records to me.
Why? It's very strange and difficult to operate, right?
Is there anyone know how to make the SSMSE to return whole records without any close query form and re-create query form operation?
Thanks a lot!
And Merry X'max!!!
View 4 Replies
View Related
Apr 2, 2001
I am totaly confused please help
I am trying to change a tring of 7 characters of the format "XXYZZZZ" to be
"XX0YZZZZ" I wonder if any body has any idea
Also how can get an out of a dattime field in the format of DDMMYYYY and converted into text.
You help is highly appreciated
View 1 Replies
View Related
May 15, 2001
Hi!
I am using the follwing query for extracting the country name and city in a COLUMN [Destination Name] in Destinations table. The Data in the table looks like:
CANADA - Toronto
United States- ARIZONA
France
Argentina
United States (USA)- ARIZONA
........
........
The folowing query is producing the required results upto soem extent but without using -1 in subtracting the one value of CHARINDEX. The error is:
Server: Msg 536, Level 16, State 4, Line 1
Invalid length parameter passed to the substring function.
The statement has been terminated.
QUERY
-----
select
Left(
Destinations.[Destination Name],
charindex("-", Destinations.[Destination Name])-1
)
as test
into temp2
from destinations
CAN ANYBODY HELP me in extracting the city an dcoutry name. I also want to delete the name in () like (USA).
View 1 Replies
View Related
Nov 30, 2004
I was given a script that was supposed to take a name field that was separated by commas and normalize it into last, first and middle name. My data looks like below in one fieldname called longname
crab,mike,Allen
Lota Weilly,Eric,M
My script to do this looks like
update ailoca
set last_name = substring (longname, 1, patindex( '%,%' , longname) -1 ),
first_name = substring (longname, patindex( '%,%' , longname) + 1, patindex( '% %', longname)-patindex( '%,%' , longname)),
middle_name = substring (longname, patindex( '% %', longname) + 1, len(longname)-patindex( '%,%' , longname))
My problem is that some people actually have 2 last names, not hyphenated, but 2. Whenever I have 2 names I get the following error
Server: Msg 536, Level 16, State 3, Line 1
Invalid length parameter passed to the substring function.
The statement has been terminated.
It seems to be related to the first name, I can comment out that update and it works
Thanks
Thanks
View 11 Replies
View Related
Jul 24, 2007
Hi All,
I am trying to break the string that looks like this
2007-05-06 07:36:21.28 server Copyright (C) 1988-2002 Microsoft Corporation.
2007-05-06 07:36:21.28 server All rights reserved.
2007-05-06 07:36:21.28 server Server Process ID is 292.
into three separate strings to look like this
col1 col2 col3
2007-05-06 07:36:21.28 server Copyright (C) 1988-2002 Microsoft Corporation.
2007-05-06 07:36:21.28 server All rights reserved.
2007-05-06 07:36:21.28 server Server Process ID is 292.
I was able to separate the above string into two columns, but can't figure out how to put the rest of the string into the third column.
Any help is appreciated.
Thanks.
View 2 Replies
View Related
Nov 13, 2005
Field1 = Dominguez Public Transport Division 03 9320 4326
how do i remove these strings in T-SQL
Field1 = Dominguez
Field2 = Public Transport Division
Field3 = 03 9320 4326
View 3 Replies
View Related
Jul 24, 2007
Hi All,
I am trying to break the string that looks like this
2007-05-06 07:36:21.28 server Copyright (C) 1988-2002 Microsoft Corporation.
2007-05-06 07:36:21.28 server All rights reserved.
2007-05-06 07:36:21.28 server Server Process ID is 292.
into three separate strings to look like this
col1 col2 col3
2007-05-06 07:36:21.28 server Copyright (C) 1988-2002 Microsoft Corporation.
2007-05-06 07:36:21.28 server All rights reserved.
2007-05-06 07:36:21.28 server Server Process ID is 292.
I was able to separate the above string into two columns, but can't figure out how to put the rest of the string into the third column.
Any help is appreciated.
Thanks.
View 3 Replies
View Related
May 3, 2008
Sir
How i m Manipulate String , I have
(ABC,XYZ,EFG) this string
know i want to break this string 1 by 1 and modify and then rearrange in same form ang Get
like (ABCWE,XYZRT,EF)
pls help me out
Yaman
View 2 Replies
View Related
May 29, 2008
Hi
I have a field which is a file path
like
'C:avde8393948.txt'
I want to separate them into folder and filename
now the filename is always the same length,
so i can use RIGHT to get the filename,
but i prefer a method that from the right detects the
1st occurance of and everything after is the filename,
View 2 Replies
View Related
Aug 29, 2007
Hi If i have a string like :
AX4030303022
in one field and need to split it into
AX 030303022
I can use LEFT(field_name,2) for the 1st one, but
what can i use for the 2nd ?
and how can i deal with NULLS ?
if its NULL i want a blank space..
View 16 Replies
View Related
Jul 20, 2005
We have some rows that we need to do some tricky string manipulationon.We have a UserID column which has userid entries in the formatfirstname.lastname and i need to change each entry tolastname.firstnameCan this be done by some script?Thanks so much for your help.Sid
View 3 Replies
View Related
Aug 13, 2007
Hi all,
I am having problem in string manipulation in SSIS - Derived Column Transformation.
I am trying to extract the OU names from Active Directory objects into a SQL table.
Assume that a distinguish name (DN) of an object as below:
CN=John, Doe,OU=Users,OU=SubOU,OU=ParentOU,DC=domain,DC=company,DC=com
How can I manipulate the above string so that I get:
ParentOU/SubOU/Users
Thanks in advance. Help is much appreciated!
View 8 Replies
View Related
Sep 15, 2015
I have the following data in a table;
Create Table #Table (Column1 Varchar(1000))
INSERT INTO #Table
Select 'Execute Procedure @param1 = 100, @param2 = 1000, @param3 = ''longtext'' '
UNION ALL
Select 'Execute Procedure @param1 = 10, @param2 = 1000, @param3 = ''longtext'' '
UNION ALL
Select 'Execute Procedure @param1 = 100000, @param2 = 1000, @param3 = ''longtext'' '
Select * from #Table
I want to get rid of @Param1 in every row of the table so my final results look like this.
Create Table #FinalTable (Column1 Varchar(1000))
INSERT INTO #FinalTable
Select 'Execute Procedure @param2 = 1000, @param3 = ''longtext'' '
UNION ALL
Select 'Execute Procedure @param2 = 1000, @param3 = ''longtext'' '
UNION ALL
Select 'Execute Procedure @param2 = 1000, @param3 = ''longtext'' '
Select * from #FinalTable
The tricky part is that the @param1 value length varies so a straight forward substring or replace function won't work.
View 1 Replies
View Related
Mar 31, 2008
Greetings all,
What's the neatest way to get the whole string but the last word?
e.g.
'THE CAT SAT ON THE MAT' would become 'THE CAT SAT ON THE'
My solution :
select left(@test, len(@test)-charindex(' ', reverse(@test)))
Thanks in advance.
View 1 Replies
View Related
Oct 27, 2005
I have a sql query in which I need to isolate part of the columm valueand return only that isolated portion. I can only do this within theselect statement, and cannot add a function or anything like that. Iwould also like to keep this query within sql (I don't want to do thisin my programming environment)The string value would normally look like "segment1-segment2-segment3".I need to isolate segment2, but I have to be able to account forsituations in which either one or both dashes are missing (in whichcase returning "" or the whole string is OK. The best I have been ableto do reliably is to get "segment2-segment3".Anybody want to take a stab?
View 4 Replies
View Related
Dec 9, 2007
Is there anything in SSIS that enables simple string reformatting?
For example I'd like to convert the character string 1234567.89 to 1,234,567.89.
I used to do this with an edit pattern in Cobol, but I can't see anything in the Expressions editor....
View 4 Replies
View Related
Jan 21, 2005
Hi Guys,
I have an nVarChar field named "Event" (I know - I didn't name it !) with variable length values such as *ALARM* or *RESTORE*
They always start or end with a * and I want to trim them off before returning the data to my app.
I've got rid of the first one with...
LTRIM(STUFF(Event, 1, 1, ''))
Any tips on how to get rid of both of them in one go ?
Thanks in advance.
Steve.
View 2 Replies
View Related
Oct 24, 2001
Hi,
I am building a string (basically XML) on the fly in stored procedure (SQL 7.0). I am using one local variable @str_xml varchar(8000) to build this string.
Now my problem is I can store maximum upto 8000 characters in "varchar type". And I can't use text field as SQL Server doesn't allow "text type" to be used as local variable.
I am thinking to use 2 or 3 local varchar variables and then return them separately to front end and will do contatination at the front end. But I think it would be ugly way to do as I have to check every time in stored procedure the length of string.
Any suggestions to do this in some other way would be greatly helpful to me.
Thanks
Dinesh
View 1 Replies
View Related
Mar 5, 2007
I'm hoping someone can help! Im using sql2000, and I am attempting to capitalize every 1st letter of a word in a column.
For Example:
"GOLF IS FUN,BOWLING IS GREAT"
What Id like to get as my results:
"Golf is fun, Bowling is great"
Trying to figure out the syntax to get the character after the comma to have a space then capital "B" Thought I could use a charindex but just cant seem to get it.
View 4 Replies
View Related
Nov 2, 2006
I am somewhat new to the world of programming with SQL Server and was wondering if this could be done. Well I know it can be done but was wondering how it might be done.
I have a DTS package created to import a table from and AS400 server. What I need to do is take one field and parse that field into 5 different values for 5 new fields.
Here is what I know needs to be done but not sure how to put into the procedure.
CREATE proc ChangeHIS
as
--Declare Variables
Declare @LastName varchar,
@FirstName varchar,
@MI varchar,
@ID varchar,
@Dept varchar,
@intCount int,
@UserName varchar,
@strTemp varchar
--Create Temporary Table
CREATE TABLE [EmployeeAudit].[dbo].[tmpTable] (
[UPUPRF] varchar (10),
[UPTEXT] varchar (50)
)
select [UPUPRF], [UPTEXT] from tblHIS into tmpTable
GO
And something dealing with the below code as well.
@tmpString = RTRIM(LTRIM(@tmpString))
If charindex(@tmpString, ",") > 0
--'Manuel, Michael J - 78672 - SR MIS SUPPORT SPEC'
@LastName = Left(@tmpString, charindex(@tmpString, ","))
@tmpString = RTRIM(LTRIM(Right(@tmpString, Len(@tmpString) - charindex(@tmpString, ",") + 1)))
--'Michael J - 78672 - SR MIS SUPPORT SPEC'
@FirstName = Left(@tmpString, charindex(@tmpString, " "))
@tmpString = RTRIM(LTRIM(Right(@tmpString, Len(@tmpString) - charindex(@tmpString, " ") + 1)))
If charindex(@tmpString, "-") > 1
--'J - 78672 - SR MIS SUPPORT SPEC'
@MI = Left(@tmpString, 1)
@tmpSting = RTRIM(LTRIM(Right(@tmpString, Len(@tmpString) - 2)
End
--'- 78672 - SR MIS SUPPORT SPEC'
@ID = Left(@tmpString, charindex(@tmpString, " - "))
@tmpString = RTRIM(LTRIM(Right(@tmpString, Len(@tmpString) - charindex(@tmpString, " - ") + 3)))
--'SR MIS SUPPORT SPEC'
@Dept = @tmpString
End
Hope someone can point me in the right direction
View 13 Replies
View Related
Mar 14, 2008
Please help me with the sql script to manipulate the string data:
I need to add <Text> at the beginning and end of the string.
I also need to add <option> before the first and after last occurence of the <Option> string. The original string
<StockNumber>502</StockNumber>
<OptionKey>113</OptionKey>
<OptionKey>151</OptionKey>
<Warranty>1</Warranty>
should look like
<Text>
<StockNumber>502</StockNumber>
<Option>
<OptionKey>113</OptionKey>
<OptionKey>151</OptionKey>
<Option>
<Warranty>1</Warranty>
<Text>
Thanks.
View 6 Replies
View Related
Oct 25, 2005
I am having some trouble creating a query that will preform some string manipulations on a field, and include this as part of the WHERE clause
For example I want to do something like this:
Code:
SELECTTable1.Column1,
Table1.Column2,
Table1.Column3,
Table2.Column1
FROMTable1
INNER JOIN Table2 ON Table1.UID = Table2.UID
WHERE(SET @Temp = Table2.Column1
--remove all 0's
SET @k = patindex('%[^0 ]%', @Temp)
WHILE @k> 0
BEGIN
SET @Temp = replace(@Temp, substring(@Temp, @k, 1), '')
SET @k= patindex('%[^0 ]%', @Temp)
END
SELECT @Temp
) = ''
But of course this isn't working so much. I am wondering if I have to use a cursor?
View 1 Replies
View Related
Apr 9, 2015
I have data in a trace file, and I need to extract some info such as phone number.The problem is the phone number could be varying lengths, and various positions in the row.
For example:
@City='New York', @Phone='2035551212' (10 characters, no dashes)
or
@City='San Francisco', @Phone='918-555-1212' (12 characters, with dashes)
or
@City+'Berlin', @Phone='55-123456-7890' (14 characters, with dashes)
I can use CHARINDEX to search & find @Phone=' so I know where the phone number starts, but stuck on a programatic way to find the data between the quotes since it can vary.
View 4 Replies
View Related
Jan 9, 2008
Hi
I'm used to DTS but new to SSIS. What's a good reference/tutorial that deals with transforming columns of data (from a flat file) from one format to another when uploading into SQL2005? Typically columns of data have "" around the values and spaces that I want to remove.
Presumably in SSIS I need the following:
A Data flow task containing:
Flat file source
Derived or Copy Column?
OLE DB Destination
Is this on the right track?
Thanks
Gerry
View 1 Replies
View Related
Oct 19, 2015
I am having a field 'Flight Route that holds hyphen delimited character sequences.
E.g. : ABC-BCD-DEF-EFG.
My requirement is like this:
If the flight route is:
ABC-BCD-BCD-DEF make it ABC-BCD-DEF
ABC-ABC-BCD-DEF make it ABC-BCD-DEF
i.e. 'whenever a sequence repeats,only one appearance of that sequence should be displayed.The field Flight Route has to be updated with this replaced string.
View 6 Replies
View Related
Nov 7, 2015
The recipe preparation instructions are stored in a table by RecipeID. Â The prep instructions are in a single VARCHAR(MAX) column and look something like this: Â
1. Â Boil WaterÂ
2. Add noodlesÂ
3. Add cheese sauceÂ
4. Stir well
Now they want this single VARCHAR(Max) column broken into 2 columns - Step and Prep Instruction like this: Boil WaterAdd noodlesAdd cheese sauceStir well.I figure I can use the appearance of a number followed by a period and a space to determine the existence of a new row. Â How would I accomplish this in T-SQL?
View 11 Replies
View Related
Sep 29, 2006
Hi,
I'm writing some SQL and want to convert the following expression into a date format in the SELECT list:
'01/'&Month(OrderDate)&'/'&Year(OrderDate)
Basically, I want to look at each order date, convert that date to the first of that month and GROUP BY this expression.
There is a CONVERT function, but I'm new to all this and can't seem to get it to work.
Any help would be gratefully received!
Cheers!
Keith
View 8 Replies
View Related
Jun 16, 2004
I have created a registration form. It works fine IF ALL fields are filled. However, all fields are not required. When I test the registration page and leave a field blank, I receive the following message:
Exception Details: System.Data.SqlClient.SqlException: String or binary data would be truncated. The statement has been terminated.
Stack Trace:
[SqlException: String or binary data would be truncated.
The statement has been terminated.]
Even if I leave a validated field blank, I receive the same message instead of the required field validation control error message.
Here is the code for the registration page. I use web matrix to create the code as directed in the tutorial.
Can anyone help a newbie?
Function AddMember( _
ByVal firstName As String, _
ByVal lastName As String, _
ByVal streetAddress1 As String, _
ByVal streetAddress2 As String, _
ByVal memCity As String, _
ByVal state As String, _
ByVal zipCode As String, _
ByVal primAreaCode As String, _
ByVal primPhone As String, _
ByVal primExt As String, _
ByVal secAreaCode As String, _
ByVal secPhone As String, _
ByVal secExt As String, _
ByVal memEmail As String, _
ByVal memUserID As String, _
ByVal memPassword As String, _
ByVal secretQuestion As String, _
ByVal secretAnswer As String, _
ByVal memBirthMonth As String, _
ByVal memBirthDay As String, _
ByVal memBirthYear As String) As Integer
Dim connectionString As String = "server='(local)'; trusted_connection=true; database='Members'"
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "INSERT INTO [Members] ([FirstName], [LastName], [StreetAddress1], [StreetAddress2"& _
"], [MemCity], [State], [ZipCode], [PrimAreaCode], [PrimPhone], [PrimExt], [SecAr"& _
"eaCode], [SecPhone], [SecExt], [MemEmail], [MemUserID], [MemPassword], [SecretQu"& _
"estion], [SecretAnswer], [MemBirthMonth], [MemBirthDay], [MemBirthYear]) VALUES "& _
"(@FirstName, @LastName, @StreetAddress1, @StreetAddress2, @MemCity, @State, @Zip"& _
"Code, @PrimAreaCode, @PrimPhone, @PrimExt, @SecAreaCode, @SecPhone, @SecExt, @Me"& _
"mEmail, @MemUserID, @MemPassword, @SecretQuestion, @SecretAnswer, @MemBirthMonth"& _
", @MemBirthDay, @MemBirthYear)"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_firstName As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_firstName.ParameterName = "@FirstName"
dbParam_firstName.Value = firstName
dbParam_firstName.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_firstName)
Dim dbParam_lastName As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_lastName.ParameterName = "@LastName"
dbParam_lastName.Value = lastName
dbParam_lastName.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_lastName)
Dim dbParam_streetAddress1 As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_streetAddress1.ParameterName = "@StreetAddress1"
dbParam_streetAddress1.Value = streetAddress1
dbParam_streetAddress1.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_streetAddress1)
Dim dbParam_streetAddress2 As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_streetAddress2.ParameterName = "@StreetAddress2"
dbParam_streetAddress2.Value = streetAddress2
dbParam_streetAddress2.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_streetAddress2)
Dim dbParam_memCity As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_memCity.ParameterName = "@MemCity"
dbParam_memCity.Value = memCity
dbParam_memCity.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_memCity)
Dim dbParam_state As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_state.ParameterName = "@State"
dbParam_state.Value = state
dbParam_state.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_state)
Dim dbParam_zipCode As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_zipCode.ParameterName = "@ZipCode"
dbParam_zipCode.Value = zipCode
dbParam_zipCode.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_zipCode)
Dim dbParam_primAreaCode As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_primAreaCode.ParameterName = "@PrimAreaCode"
dbParam_primAreaCode.Value = primAreaCode
dbParam_primAreaCode.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_primAreaCode)
Dim dbParam_primPhone As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_primPhone.ParameterName = "@PrimPhone"
dbParam_primPhone.Value = primPhone
dbParam_primPhone.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_primPhone)
Dim dbParam_primExt As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_primExt.ParameterName = "@PrimExt"
dbParam_primExt.Value = primExt
dbParam_primExt.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_primExt)
Dim dbParam_secAreaCode As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_secAreaCode.ParameterName = "@SecAreaCode"
dbParam_secAreaCode.Value = secAreaCode
dbParam_secAreaCode.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_secAreaCode)
Dim dbParam_secPhone As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_secPhone.ParameterName = "@SecPhone"
dbParam_secPhone.Value = secPhone
dbParam_secPhone.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_secPhone)
Dim dbParam_secExt As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_secExt.ParameterName = "@SecExt"
dbParam_secExt.Value = secExt
dbParam_secExt.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_secExt)
Dim dbParam_memEmail As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_memEmail.ParameterName = "@MemEmail"
dbParam_memEmail.Value = memEmail
dbParam_memEmail.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_memEmail)
Dim dbParam_memUserID As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_memUserID.ParameterName = "@MemUserID"
dbParam_memUserID.Value = memUserID
dbParam_memUserID.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_memUserID)
Dim dbParam_memPassword As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_memPassword.ParameterName = "@MemPassword"
dbParam_memPassword.Value = memPassword
dbParam_memPassword.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_memPassword)
Dim dbParam_secretQuestion As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_secretQuestion.ParameterName = "@SecretQuestion"
dbParam_secretQuestion.Value = secretQuestion
dbParam_secretQuestion.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_secretQuestion)
Dim dbParam_secretAnswer As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_secretAnswer.ParameterName = "@SecretAnswer"
dbParam_secretAnswer.Value = secretAnswer
dbParam_secretAnswer.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_secretAnswer)
Dim dbParam_memBirthMonth As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_memBirthMonth.ParameterName = "@MemBirthMonth"
dbParam_memBirthMonth.Value = memBirthMonth
dbParam_memBirthMonth.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_memBirthMonth)
Dim dbParam_memBirthDay As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_memBirthDay.ParameterName = "@MemBirthDay"
dbParam_memBirthDay.Value = memBirthDay
dbParam_memBirthDay.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_memBirthDay)
Dim dbParam_memBirthYear As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_memBirthYear.ParameterName = "@MemBirthYear"
dbParam_memBirthYear.Value = memBirthYear
dbParam_memBirthYear.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_memBirthYear)
Dim rowsAffected As Integer = 0
dbConnection.Open
Try
rowsAffected = dbCommand.ExecuteNonQuery
Finally
dbConnection.Close
End Try
Return rowsAffected
End Function
View 2 Replies
View Related
Jul 13, 2007
Im trying to determine the best way to store data gathered from a form that a user will fill out online. The form is dynamic and is customized at run time based on group-specific criteria. The end result is a form that might have 3 extra text boxes, 2 extra sets of radio buttons and a freeform textbox, whereas for another group, there might be a slightly different set of input fields. Now comes the issue of storing this data. Since the fields can be somewhat dynamic, it could get tricky to define table columns for each possible input field. So Im considering storing the data as xml. Has anyone else had to build custom forms and ended up storing the data as xml ?
View 2 Replies
View Related
Jul 24, 2004
i am using this statement
select dateadd(dd,1,20010331)
and it's throwing an error
Arithmetic overflow error converting expression to data type datetime.
what's wrong?
View 2 Replies
View Related
Apr 5, 2008
I have two tables. The table is below.
Table name 1 : Income
Income RentMonth
1500 Jan
1500 Feb
1500 Apr
Table name 2 : Expense
Expense ExpMonth
200 Jan
300 Mar
400 Apr
The result table becomes (Profit=Income-Expense)
Profit Month
1300 Jan
1500 Feb
-300 Mar
1100 Apr
But I form the query by join the both Income and Expense tables to subtract the Income and Expense month wise.
But one moth is in one table the same month is not in another table.
For Example Feb month is in Income table, but not in Expense table.And Mar month is in Expense table and not in Income table. So how will I form the query to achieve my result table as i indicated above. Kindly help me.
Kamal.
View 2 Replies
View Related