Friday, March 30, 2012
Help!. Images not Displaying
i have made a report and inserted some company logo in the report header ,,,
from the image wizard i selected Embeded type ,, But when i run the port in
asp.net by calling its webservice ,,,images are not shown.
Plz help me to solve this problem
ThanksHi Malik,
Please look at following link. "_" in the machine name may be the
culprit. Use the IP instead of machine name. Also replace machine name in
report server and report manager config files with machine IP address.
http://groups.google.com.pk/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/dc1fcfec0c41ec70/23425c9cbdabb2a1?q=%22reporting+services%22+%2B+%22images%22&rnum=1&hl=en#23425c9cbdabb2a1
"Malik Asif Joyia" wrote:
> Hello
> i have made a report and inserted some company logo in the report header ,,,
> from the image wizard i selected Embeded type ,, But when i run the port in
> asp.net by calling its webservice ,,,images are not shown.
> Plz help me to solve this problem
> Thanks
>
>sql
HELP!!!
after this
i am out of my wits to thing for what data type to use. because for
everything i tried i got the error below the column name will be for the
table i appreciate a lot if someone can help me .
column 1 column 2 column 3
OMIM_Name No.of av Description
100650 .0001 ALCOHOL INTOLERANCE, ACUTE ACETALDEHYDE DEHYDROGENASE 2, ALLELE
2, INCLUDED; ALDH2*2, INCLUDED ALDH2, GLU487LYS The ALDH2*2-encoded protein
has a change from glutamic acid (glutamate) to lysine at residue 487 (Yoshid
a
et al., 1984). Hempel et al. (1985) and Hsu et al. (1985) also showed that
the catalytic deficiency in mitochondrial ALDH in Orientals can be traced to
a structural point mutation at amino acid position 487 of the polypeptide. A
substitution of lysine for glutamic acid results from a transition of G-C to
A-T. To study the mechanism by which the ALDH2*2 allele exerts its dominant
effect in decreasing ALDH2 activity in liver extracts and producing cutaneou
s
flushing when the subject drinks alcohol, Xiao et al. (1995) cloned ALDH2*1
cDNA and generated the ALDH2*2 allele by site-directed mutagenesis. These
cDNAs were transduced using retroviral vectors into HeLa and CV1 cells, whic
h
do not express ALDH2. The normal allele directed synthesis of immunoreactive
ALDH2 protein with the expected isoelectric point and increased aldehyde
dehydrogenase activity. The ALDH2*2 allele directed synthesis of mRNA and
immunoreactive protein, but the protein lacked enzymatic activity. When
ALDH2*1-expressing cells were transduced with ALDH2*2 vectors, both mRNAs
were expressed and immunoreactive proteins with isoelectric points ranging
between those of the 2 gene products were present, indicating that the
subunits formed heteromers. ALDH2 activity in these cells was reduced below
that of the parental ALDH2*1-expressing cells. Thus, the authors concluded
that ALDH2*2 allele is sufficient to cause ALDH2 deficiency in vitro. Xiao e
t
al. (1996) referred to the ALDH2 enzyme encoded by the ALDH2*1 allele (the
wildtype form) as ALDH2E and the enzyme subunit encoded by ALDH2*2 as ALDH2K
.
They found that the ALDH2E enzyme was very stable, with a half-life of at
least 22 hours. ALDH2K, on the other hand, had an enzyme half-life of only 1
4
hours. In cells expressing both subunits, most of the subunits assemble as
heterotetramers, and these enzymes had a half-life of 13 hours. Thus, the
effect of ALDH2K on enzyme turnover is dominant. Their studies indicated tha
t
ALDH2*2 exerts its dominant effect both by interfering with the catalytic
activity of the enzyme and by increasing its turnover. Because genetic
epidemiologic studies have suggested a mechanism by which homozygosity for
the ALDH2*2 allele inhibits the development of alcoholism in Asians, Peng et
al. (1999) recruited 18 adult Han Chinese men, matched by age, body-mass
index, nutritional state, and homozygosity at the ALDH2 gene loci from a
population of 273 men. Six individuals were chosen for each of the 3 ALDH2
allotypes, i.e., 2 homozygotes and 1 heterozygote. Following a low dose of
ethanol, homozygous ALDH2*2 individuals were found to be strikingly
responsive with pronounced cardiovascular hemodynamic effects as well as
subjective perception of general discomfort for as long as 2 hours following
ingestion. Among 71 Japanese nondrinkers and 268 drinkers of alcohol, Liu et
al. (2005) found that drinkers had a significantly higher frequency of the
487glu allele. Individuals with the 487lys allele had an increased risk of
alcohol-induced flushing (odds ratio of 33.0)
100690 .0001 MYASTHENIC SYNDROME, CONGENITAL, SLOW-CHANNEL CHRNA1, ASN217LYS
In a 30-year-old woman with slow-channel congenital myasthenic syndrome
(601462), Engel et al. (1996) identified a heterozygous 651C-G transversion
in exon 6 of the CHRNA1 gene, resulting in an asn217-to-lys (N217K)
substitution at a conserved residue in the M1 transmembrane domain. The
mutation cosegregated with the disease through 3 generations. Functional
expression studies showed that the N217K mutation slowed the rate of AChR
channel closure, increased the apparent affinity for ACh, and enhanced
desensitization. Cationic overload of the postsynaptic region caused an
endplate myopathy
100690 .0002 MYASTHENIC SYNDROME, CONGENITAL, SLOW-CHANNEL CHRNA1, VAL156MET
In a patient with SCCMS (601462), Croxen et al. (1997) identified a
heterozygous 466G-A transition in the CHRNA1 gene, resulting in a
val156-to-met (V156M) substitution in a putative ACh-binding region of the
protein. Functional studies suggested that the V156M mutation stabilizes the
open state of the AChR channel
100690 .0003 MYASTHENIC SYNDROME, CONGENITAL, SLOW-CHANNEL CHRNA1, THR254ILE
In a 60-year-old woman whose myasthenic syndrome (SCCMS; 601462) had first
become symptomatic at the age of 16, Croxen et al. (1997) identified a
heterozygous 761C-T transition in the CHRNA1 gene, resulting in a
thr254-to-ile (T254I) substitution in the M2 transmembrane domain which line
s
the AChR channel pore. The patient was previously reported by Chauplannaz an
d
Bady (1994). Functional expression studies suggested that the T254I mutation
stabilized the open state of the AChR channel
C:\Disease_Database_TongBoon_Dec2005_Mar
ch2006\Results>bcp OMIM.dbo.av in
AVoutp
ut_less_then_100.txt -c -T
Starting copy...
SQLState = 22001, NativeError = 0
Error = [Microsoft][SQL Native Client]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Microsoft][SQL Native Client]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Microsoft][SQL Native Client]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Microsoft][SQL Native Client]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Microsoft][SQL Native Client]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Microsoft][SQL Native Client]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Microsoft][SQL Native Client]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Microsoft][SQL Native Client]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Microsoft][SQL Native Client]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Microsoft][SQL Native Client]String data, right truncation
BCP copy in failedGood god! Please post a description of the source data, rather than posting
a
big blob. Also see http://www.aspfaq.com/etiquette.asp?id=5006 for some
pointers.
How are you importing this? Where are you importing it to? Where is it from?
What is the structure of the source, and what of the destination?
ML
http://milambda.blogspot.com/|||What vesrion are you using?
"urgent" <urgent@.discussions.microsoft.com> wrote in message
news:89CCAC1D-8F47-4D01-A35D-25254C26BD9B@.microsoft.com...
> please help me create the table for the data in the following data lines
> after this
> i am out of my wits to thing for what data type to use. because for
> everything i tried i got the error below the column name will be for the
> table i appreciate a lot if someone can help me .
>
> column 1 column 2 column 3
> OMIM_Name No.of av Description
> 100650 .0001 ALCOHOL INTOLERANCE, ACUTE ACETALDEHYDE DEHYDROGENASE 2,
> ALLELE
> 2, INCLUDED; ALDH2*2, INCLUDED ALDH2, GLU487LYS The ALDH2*2-encoded
> protein
> has a change from glutamic acid (glutamate) to lysine at residue 487
> (Yoshida
> et al., 1984). Hempel et al. (1985) and Hsu et al. (1985) also showed that
> the catalytic deficiency in mitochondrial ALDH in Orientals can be traced
> to
> a structural point mutation at amino acid position 487 of the polypeptide.
> A
> substitution of lysine for glutamic acid results from a transition of G-C
> to
> A-T. To study the mechanism by which the ALDH2*2 allele exerts its
> dominant
> effect in decreasing ALDH2 activity in liver extracts and producing
> cutaneous
> flushing when the subject drinks alcohol, Xiao et al. (1995) cloned
> ALDH2*1
> cDNA and generated the ALDH2*2 allele by site-directed mutagenesis. These
> cDNAs were transduced using retroviral vectors into HeLa and CV1 cells,
> which
> do not express ALDH2. The normal allele directed synthesis of
> immunoreactive
> ALDH2 protein with the expected isoelectric point and increased aldehyde
> dehydrogenase activity. The ALDH2*2 allele directed synthesis of mRNA and
> immunoreactive protein, but the protein lacked enzymatic activity. When
> ALDH2*1-expressing cells were transduced with ALDH2*2 vectors, both mRNAs
> were expressed and immunoreactive proteins with isoelectric points ranging
> between those of the 2 gene products were present, indicating that the
> subunits formed heteromers. ALDH2 activity in these cells was reduced
> below
> that of the parental ALDH2*1-expressing cells. Thus, the authors concluded
> that ALDH2*2 allele is sufficient to cause ALDH2 deficiency in vitro. Xiao
> et
> al. (1996) referred to the ALDH2 enzyme encoded by the ALDH2*1 allele (the
> wildtype form) as ALDH2E and the enzyme subunit encoded by ALDH2*2 as
> ALDH2K.
> They found that the ALDH2E enzyme was very stable, with a half-life of at
> least 22 hours. ALDH2K, on the other hand, had an enzyme half-life of only
> 14
> hours. In cells expressing both subunits, most of the subunits assemble as
> heterotetramers, and these enzymes had a half-life of 13 hours. Thus, the
> effect of ALDH2K on enzyme turnover is dominant. Their studies indicated
> that
> ALDH2*2 exerts its dominant effect both by interfering with the catalytic
> activity of the enzyme and by increasing its turnover. Because genetic
> epidemiologic studies have suggested a mechanism by which homozygosity for
> the ALDH2*2 allele inhibits the development of alcoholism in Asians, Peng
> et
> al. (1999) recruited 18 adult Han Chinese men, matched by age, body-mass
> index, nutritional state, and homozygosity at the ALDH2 gene loci from a
> population of 273 men. Six individuals were chosen for each of the 3 ALDH2
> allotypes, i.e., 2 homozygotes and 1 heterozygote. Following a low dose of
> ethanol, homozygous ALDH2*2 individuals were found to be strikingly
> responsive with pronounced cardiovascular hemodynamic effects as well as
> subjective perception of general discomfort for as long as 2 hours
> following
> ingestion. Among 71 Japanese nondrinkers and 268 drinkers of alcohol, Liu
> et
> al. (2005) found that drinkers had a significantly higher frequency of the
> 487glu allele. Individuals with the 487lys allele had an increased risk of
> alcohol-induced flushing (odds ratio of 33.0)
> 100690 .0001 MYASTHENIC SYNDROME, CONGENITAL, SLOW-CHANNEL CHRNA1,
> ASN217LYS
> In a 30-year-old woman with slow-channel congenital myasthenic syndrome
> (601462), Engel et al. (1996) identified a heterozygous 651C-G
> transversion
> in exon 6 of the CHRNA1 gene, resulting in an asn217-to-lys (N217K)
> substitution at a conserved residue in the M1 transmembrane domain. The
> mutation cosegregated with the disease through 3 generations. Functional
> expression studies showed that the N217K mutation slowed the rate of AChR
> channel closure, increased the apparent affinity for ACh, and enhanced
> desensitization. Cationic overload of the postsynaptic region caused an
> endplate myopathy
> 100690 .0002 MYASTHENIC SYNDROME, CONGENITAL, SLOW-CHANNEL CHRNA1,
> VAL156MET
> In a patient with SCCMS (601462), Croxen et al. (1997) identified a
> heterozygous 466G-A transition in the CHRNA1 gene, resulting in a
> val156-to-met (V156M) substitution in a putative ACh-binding region of the
> protein. Functional studies suggested that the V156M mutation stabilizes
> the
> open state of the AChR channel
> 100690 .0003 MYASTHENIC SYNDROME, CONGENITAL, SLOW-CHANNEL CHRNA1,
> THR254ILE
> In a 60-year-old woman whose myasthenic syndrome (SCCMS; 601462) had first
> become symptomatic at the age of 16, Croxen et al. (1997) identified a
> heterozygous 761C-T transition in the CHRNA1 gene, resulting in a
> thr254-to-ile (T254I) substitution in the M2 transmembrane domain which
> lines
> the AChR channel pore. The patient was previously reported by Chauplannaz
> and
> Bady (1994). Functional expression studies suggested that the T254I
> mutation
> stabilized the open state of the AChR channel
>
> C:\Disease_Database_TongBoon_Dec2005_Mar
ch2006\Results>bcp OMIM.dbo.av in
> AVoutp
> ut_less_then_100.txt -c -T
> Starting copy...
> SQLState = 22001, NativeError = 0
> Error = [Microsoft][SQL Native Client]String data, right truncation
> SQLState = 22001, NativeError = 0
> Error = [Microsoft][SQL Native Client]String data, right truncation
> SQLState = 22001, NativeError = 0
> Error = [Microsoft][SQL Native Client]String data, right truncation
> SQLState = 22001, NativeError = 0
> Error = [Microsoft][SQL Native Client]String data, right truncation
> SQLState = 22001, NativeError = 0
> Error = [Microsoft][SQL Native Client]String data, right truncation
> SQLState = 22001, NativeError = 0
> Error = [Microsoft][SQL Native Client]String data, right truncation
> SQLState = 22001, NativeError = 0
> Error = [Microsoft][SQL Native Client]String data, right truncation
> SQLState = 22001, NativeError = 0
> Error = [Microsoft][SQL Native Client]String data, right truncation
> SQLState = 22001, NativeError = 0
> Error = [Microsoft][SQL Native Client]String data, right truncation
> SQLState = 22001, NativeError = 0
> Error = [Microsoft][SQL Native Client]String data, right truncation
> BCP copy in failed
>|||
this is my new nick i am urgen log in with another email thi post is being
transfer to another title call trouble with bcp ....2005
HELP!! Problem in database backup and restore!
Im trying to backup the databse by selecting the database source, backup type = full, name the backup set, and leave the rest as default. The backup seems to be successful.
The problem comes when I need to restore the backup database, I 've tried many times and a few different kinds of selection, all fails. I've selected the source for restore from device, that is the .bak file from backup folder and remains the rest of selection as default. Here is the error message I get:
System.Data.SqlClient.SqlError: The backup set holds a backup of the database other than the existing 'testing' database. (Microsoft.SqlServer.Express.Smo)
Anyone can help to solve this problem?!
Create new Database. In Restore window-> Options tab, check "Force restore over existing database". And then try to restore. This may work for you.
Santosh
|||Thankz santosh...
the solution u had provided.... had successfully solved the problem mention above....but there are some database that still meets another problem during the database restore
here is the error occurs after that....
TITLE: Microsoft SQL Server Management Studio Express
Restore failed for Server 'COMP1\SQLEXPRESS'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\JGSQL.mdf' cannot be overwritten. It is being used by database 'JGSQL'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&LinkId=20476
BUTTONS:
OK
|||I've try to do the database restore using sql command as below:
RESTORE DATABASE testJG
FROM DISK = 'c:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Backup\JGsql.bak'
GO
But I get this error message.
Does this means that I need to restore the master database from systems database to the database testJG before I restore the backup database?
Msg 3102, Level 16, State 1, Line 1
RESTORE cannot process database 'testJG' because it is in use by this session. It is recommended that the master database be used when performing this operation.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
|||It was helpfull to me. Thanx! :)sqlHELP!! Problem in database backup and restore!
Im trying to backup the databse by selecting the database source, backup type = full, name the backup set, and leave the rest as default. The backup seems to be successful.
The problem comes when I need to restore the backup database, I 've tried many times and a few different kinds of selection, all fails. I've selected the source for restore from device, that is the .bak file from backup folder and remains the rest of selection as default. Here is the error message I get:
System.Data.SqlClient.SqlError: The backup set holds a backup of the database other than the existing 'testing' database. (Microsoft.SqlServer.Express.Smo)
Anyone can help to solve this problem?!
Create new Database. In Restore window-> Options tab, check "Force restore over existing database". And then try to restore. This may work for you.
Santosh
|||Thankz santosh...
the solution u had provided.... had successfully solved the problem mention above....but there are some database that still meets another problem during the database restore
here is the error occurs after that....
TITLE: Microsoft SQL Server Management Studio Express
Restore failed for Server 'COMP1\SQLEXPRESS'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\JGSQL.mdf' cannot be overwritten. It is being used by database 'JGSQL'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&LinkId=20476
BUTTONS:
OK
|||I've try to do the database restore using sql command as below:
RESTORE DATABASE testJG
FROM DISK = 'c:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Backup\JGsql.bak'
GO
But I get this error message.
Does this means that I need to restore the master database from systems database to the database testJG before I restore the backup database?
Msg 3102, Level 16, State 1, Line 1
RESTORE cannot process database 'testJG' because it is in use by this session. It is recommended that the master database be used when performing this operation.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
|||It was helpfull to me. Thanx! :)Wednesday, March 28, 2012
HELP! Users Cannot login
Is there a reindex function that I need to perform on a regular basis? I
thought SQL 2000 did this type of maint automatically?
"Narayana Vyas Kondreddi" <answer_me@.hotmail.com> wrote in message
news:enqaoGr4DHA.2136@.TK2MSFTNGP12.phx.gbl...
quote:
> What is the error when trying to login?
> Has that database been recently restored from a backup?
> In case of orphan users problem, see:
> http://vyaskn.tripod.com/troublesho...rphan_users.htm
> --
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
> Is .NET important for a database professional?
> http://vyaskn.tripod.com/poll.htm
>
>
> "Kevin Evans" <kevin@.convenientcomputing.com> wrote in message
> news:eGKDayq4DHA.488@.TK2MSFTNGP12.phx.gbl...
> I have a database and the users suddenly cannot login. All are using
Windows
quote:
> Auth. I'm not a DBA but need to fix the prob ASAP. Where can I find a
quick
quote:Enable auditing for successful & failed logins.
> resource for login issues? Can someone list some standard checks.
>
>
Verify the account that is unable to login to the server.
(login as that account and test with Query Analyser)
Verify that the account is a valid account on the server, and that the
recent database restore didn't change the users permissions.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||There's no reindexing required in the context of 'ability to log into SQL
Server'
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Kevin Evans" <kevin@.convenientcomputing.com> wrote in message
news:ezTUP5w4DHA.2412@.TK2MSFTNGP09.phx.gbl...
DB has not been recently restored from backup
Is there a reindex function that I need to perform on a regular basis? I
thought SQL 2000 did this type of maint automatically?
"Narayana Vyas Kondreddi" <answer_me@.hotmail.com> wrote in message
news:enqaoGr4DHA.2136@.TK2MSFTNGP12.phx.gbl...
quote:
> What is the error when trying to login?
> Has that database been recently restored from a backup?
> In case of orphan users problem, see:
> http://vyaskn.tripod.com/troublesho...rphan_users.htm
> --
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
> Is .NET important for a database professional?
> http://vyaskn.tripod.com/poll.htm
>
>
> "Kevin Evans" <kevin@.convenientcomputing.com> wrote in message
> news:eGKDayq4DHA.488@.TK2MSFTNGP12.phx.gbl...
> I have a database and the users suddenly cannot login. All are using
Windows
quote:
> Auth. I'm not a DBA but need to fix the prob ASAP. Where can I find a
quick
quote:
> resource for login issues? Can someone list some standard checks.
>
>
Wednesday, March 7, 2012
HELP! - Cast from DBNull when there is Data
Hi,
I have built a few pages and a stored procedure and a class on the back of a SQL2000 dbase. and I get the following error:
Cast from type 'DBNull' to type 'String' is not valid.
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:System.InvalidCastException: Cast from type 'DBNull' to type 'String' is not valid.
Source Error:
Line 111: Dim myWorkJobs As WorkJobsDATA = New WorkJobsDATALine 112:Line 113: myWorkJobs.CustomerID = CStr(parameterCustomerID.Value)Line 114: myWorkJobs.WorkID = CStr(parameterWorkID.Value)Line 115: myWorkJobs.DateOfQuote = CStr(parameterDateOfQuote.Value).Trim()
Source File:C:\Inetpub\wwwroot\Commerce\Components\WorkJobs.vb Line:113
My Database has 1 line of data (for testing) and all fields are populated. I am Querying a column called IndividualID which has a value of 3425243 at the moment. This is hardcoded in the aspx.vb at the moment.
ASPX VB:
Public Class WorkRequest
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub btnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click
'for now, send this value (stored in dbase under individualID) to the querystring
Dim IndividualID As String = "3425243"
Response.Redirect("WorkRequestMain.aspx?IndividualID=" & IndividualID)
End Sub
End Class
COMPONENTS\WorkJobs.vb (This is the class file)
Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Namespace ASPNET.StarterKit.Commerce
Public Class WorkJobsDATA
Public CustomerID As String
Public WorkID As String
Public DateOfQuote As String
Public QuoteAmount As String
Public Title As Decimal
Public FirstName As String
Public Surname As String
Public FirstLine As String
Public District As String
Public Town As String
Public Postcode As String
Public Telephone As String
Public Requirements As String
Public WorkRequired As String
Public EmailAddress As String
End Class
Public Class WorkJobs
Public Function GetWorkDetails(ByVal IndividualID As String) As WorkJobsDATA
Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim myCommand As SqlCommand = New SqlCommand("SP_PendingQuotes", myConnection)
' Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure
' Add Parameters to SPROC
Dim parameterIndividualID As SqlParameter = New SqlParameter("@.IndividualID", SqlDbType.NVarChar, 50)
parameterIndividualID.Value = IndividualID
myCommand.Parameters.Add(parameterIndividualID)
Dim parameterCustomerID As SqlParameter = New SqlParameter("@.CustomerID", SqlDbType.BigInt, 8)
parameterCustomerID.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterCustomerID)
Dim parameterWorkID As SqlParameter = New SqlParameter("@.WorkID", SqlDbType.NVarChar, 50)
parameterWorkID.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterWorkID)
Dim parameterDateOfQuote As SqlParameter = New SqlParameter("@.DateOfQuote", SqlDbType.DateTime, 8)
parameterDateOfQuote.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterDateOfQuote)
Dim parameterQuoteAmount As SqlParameter = New SqlParameter("@.QuoteAmount", SqlDbType.Money, 8)
parameterQuoteAmount.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterQuoteAmount)
Dim parameterTitle As SqlParameter = New SqlParameter("@.Title", SqlDbType.NVarChar, 50)
parameterTitle.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterTitle)
Dim parameterFirstName As SqlParameter = New SqlParameter("@.FirstName", SqlDbType.NVarChar, 50)
parameterFirstName.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterFirstName)
Dim parameterSurname As SqlParameter = New SqlParameter("@.Surname", SqlDbType.NVarChar, 50)
parameterSurname.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterSurname)
Dim parameterFirstLine As SqlParameter = New SqlParameter("@.FirstLine ", SqlDbType.NVarChar, 50)
parameterFirstLine.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterFirstLine)
Dim parameterDistrict As SqlParameter = New SqlParameter("@.District", SqlDbType.NVarChar, 50)
parameterDistrict.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterDistrict)
Dim parameterTown As SqlParameter = New SqlParameter("@.Town", SqlDbType.NVarChar, 50)
parameterTown.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterTown)
Dim parameterPostcode As SqlParameter = New SqlParameter("@.Postcode", SqlDbType.NVarChar, 50)
parameterPostcode.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterPostcode)
Dim parameterTelephone As SqlParameter = New SqlParameter("@.Telephone", SqlDbType.NVarChar, 50)
parameterTelephone.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterTelephone)
Dim parameterRequirements As SqlParameter = New SqlParameter("@.Requirements", SqlDbType.NVarChar, 3500)
parameterRequirements.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterRequirements)
Dim parameterWorkRequired As SqlParameter = New SqlParameter("@.WorkRequired", SqlDbType.NVarChar, 3500)
parameterWorkRequired.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterWorkRequired)
Dim parameterEmailAddress As SqlParameter = New SqlParameter("@.EmailAddress", SqlDbType.NVarChar, 100)
parameterEmailAddress.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parameterEmailAddress)
myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
parameterEmailAddress.Value.GetType()
Dim myWorkJobs As WorkJobsDATA = New WorkJobsDATA
myWorkJobs.CustomerID = CStr(parameterCustomerID.Value)
myWorkJobs.WorkID = CStr(parameterWorkID.Value)
myWorkJobs.DateOfQuote = CStr(parameterDateOfQuote.Value).Trim()
myWorkJobs.Title = CStr(parameterTitle.Value).Trim()
myWorkJobs.FirstName = CStr(parameterFirstName.Value).Trim()
myWorkJobs.Surname = CStr(parameterSurname.Value).Trim()
myWorkJobs.FirstLine = CStr(parameterFirstLine.Value).Trim()
myWorkJobs.District = CStr(parameterDistrict.Value).Trim()
myWorkJobs.Town = CStr(parameterTown.Value).Trim()
myWorkJobs.Postcode = CStr(parameterPostcode.Value).Trim()
myWorkJobs.Telephone = CStr(parameterTelephone.Value).Trim()
myWorkJobs.Requirements = CStr(parameterRequirements.Value).Trim()
myWorkJobs.WorkRequired = CStr(parameterWorkRequired.Value).Trim()
myWorkJobs.EmailAddress = CStr(parameterEmailAddress.Value).Trim()
Return myWorkJobs
End Function
End Class
End Namespace
And finally my stored procedure:
CREATE Procedure SP_PendingQuotes
(
@.IndividualID nvarchar,
@.CustomerID bigint OUTPUT,
@.WorkID nvarchar(50) OUTPUT,
@.DateOfQuote datetime OUTPUT,
@.QuoteAmount money OUTPUT,
@.Title nvarchar(50) OUTPUT,
@.FirstName nvarchar(50) OUTPUT,
@.Surname nvarchar(50) OUTPUT,
@.FirstLine nvarchar(50) OUTPUT,
@.District nvarchar(50) OUTPUT,
@.Town nvarchar(50) OUTPUT,
@.Postcode nvarchar(50) OUTPUT,
@.Telephone nvarchar(50) OUTPUT,
@.Requirements nvarchar(3500) OUTPUT,
@.WorkRequired nvarchar(3500) OUTPUT,
@.EmailAddress nvarchar(100) OUTPUT
)
AS
SELECT
@.IndividualID = IndividualID,
@.CustomerID = CustomerID,
@.WorkID = WorkID,
@.DateOfQuote = DateOfQuote,
@.QuoteAmount = QuoteAmount,
@.Title = Title,
@.FirstName = FirstName,
@.Surname = Surname,
@.FirstLine = FirstLine,
@.District = District,
@.Town = Town,
@.Postcode = Postcode,
@.Telephone = Telephone,
@.Requirements = Requirements,
@.WorkRequired = WorkRequired,
@.EmailAddress = EmailAddress
FROM
PendingQuotes
WHERE
IndividualID = @.IndividualID
GO
Any ideas anyone?
I appreciate this is a big amount of data, but if anyone wants to chat to me i'm available on MSN Messenger underwolvokid@.msn.com
The problem is in the stored procedure, you've defined @.IndividualID as nvarchar, specify the length, as it is defaulting to 1. Your query then returns no values because there is no record where IndividualID='3'|||
Call me muppett! It all becomes a blur after you go over and over everything a million times trying to find out whats wrong.
Thanks very much. It works now!