Showing posts with label program. Show all posts
Showing posts with label program. Show all posts

Wednesday, March 28, 2012

I dont know how to use storedProcedure that returns one value as a result to a VB calling

My stored procedure works perfectly when I run Query Analyser, but when I run my VB program I get the eror: I get the message : An SqlParameter with ParameterName'@.total' is not contained by this SqlParameterCollection.


Here is my stored Proc and my VB program is right below

I- Stored Proc:

CREATE PROCEDURE dbo.totalsub
@.account bigint,
@.total bigint output
AS
select total=sum(SubPhnNmbr) from tblsub whereSubAccNmbr=@.account
return
GO

II- And my pogram in VB is:

Dim totsub As Int64
Dim cm As New SqlCommand
Dim cn As New MyConnection
cn.open
'my connection is defined by me don't worry about it
cm.CommandType = CommandType.StoredProcedure
cm.CommandText = "totalsub"
cm.Connection = cn
Dim pm As SqlParameter
pm = cm.Parameters.Add(New System.Data.SqlClient.SqlParameter("@.Account", System.Data.SqlDbType.BigInt))
pm.Value = 100000165
pm = cm.Parameters.Add(New System.Data.SqlClient.SqlParameter("total", System.Data.SqlDbType.BigInt, 4))
pm.Direction = ParameterDirection.Output
totsub = cm.Parameters("total").Value
cm.ExecuteScalar()
totsub = cm.Parameters("total").Value


I also tried using @.total instead of total and I tried ParameterDirection.ReturmValue instead of ParameterDirection.Output

No Luck, someone pls can help

check the second part ofthis article.|||Thanks.

Friday, March 23, 2012

I can't install SQL Server 2005 Developer Edition

I copied the error I received.

SQL Server Setup cannot install files to the compressed or encrypted folder: C:\Program Files\Microsoft SQL Server\. To continue, make sure that your installation directories are not compressed or encrypted, or specify a different directory, and then run SQL Server Setup again.

C:\Program Files\Microsoft SQL Server\ is not an compressed or encrypted folder. I don't know what it is talking about. I just installed a fresh new copy of Windows XP Professional with Service Pack 2.

There are two things to check:

1) Open up Windows Explorer, right-click on the main drive (c:) and select properties. On the General tab near the bottom you'll see a check box labeled "Compress drive to save disk space" make sure this is unchecked. Note: if you have more than one drive you want to check the drive where "%Program Files%" lives. This may not be a the C drive.

2) Next, while still in Windows Explorer go to the root of where %Program Files% lives. This should probably be c:\. Right-click on "Program Files" and select Properties. Click the "Advanced..." button down in the Attributes section. Make sure the two check boxes in the "Compress or Encrypt attributes" group box are un-checked.

Dan|||Thanks a lot! It worked perfectly. Big Smile|||I do not use any compression of encryption on the hard drive.

The 'C:\Program Files' directory is marked 'Read Only' ?

I have tried several times to install SQL Server 2005 Developer Edition

(most recently from MSDN Disk 3097.1) I have tried to complete an

uninstall before each attempt.

I have installed: IIS and .NET Framework 2.0

I have also used ..\aspnet_regiis -r to register ASP.NET

I am, successfully, running Visual Studio 2005.

I do get the warning about Minimum Hardware Requirement, but can find

nothing in the detail requirements to exclude my PCs configuration.

Any suggestions will be appreciated.

I can't install SQL Server 2005 Developer Edition

I copied the error I received.

SQL Server Setup cannot install files to the compressed or encrypted folder: C:\Program Files\Microsoft SQL Server\. To continue, make sure that your installation directories are not compressed or encrypted, or specify a different directory, and then run SQL Server Setup again.

C:\Program Files\Microsoft SQL Server\ is not an compressed or encrypted folder. I don't know what it is talking about. I just installed a fresh new copy of Windows XP Professional with Service Pack 2.

There are two things to check:

1) Open up Windows Explorer, right-click on the main drive (c:) and select properties. On the General tab near the bottom you'll see a check box labeled "Compress drive to save disk space" make sure this is unchecked. Note: if you have more than one drive you want to check the drive where "%Program Files%" lives. This may not be a the C drive.

2) Next, while still in Windows Explorer go to the root of where %Program Files% lives. This should probably be c:\. Right-click on "Program Files" and select Properties. Click the "Advanced..." button down in the Attributes section. Make sure the two check boxes in the "Compress or Encrypt attributes" group box are un-checked.

Dan|||Thanks a lot! It worked perfectly. Big Smile|||I do not use any compression of encryption on the hard drive.

The 'C:\Program Files' directory is marked 'Read Only' ?

I have tried several times to install SQL Server 2005 Developer Edition

(most recently from MSDN Disk 3097.1) I have tried to complete an

uninstall before each attempt.

I have installed: IIS and .NET Framework 2.0

I have also used ..\aspnet_regiis -r to register ASP.NET

I am, successfully, running Visual Studio 2005.

I do get the warning about Minimum Hardware Requirement, but can find

nothing in the detail requirements to exclude my PCs configuration.

Any suggestions will be appreciated.

Monday, March 19, 2012

i cannot insert data into MS SQL through ASP,but...

I cannot insert data into MS SQL through ASP,but i can update it with asp
program,so i need your help. Any sugestin will be hightly appreciated
davidGood question David
How do you think we can suggest you something without seeng your INSERT
statement as well as an ERROR you are getting?
Check out if the table has a trigger for INSERT.
"msnews" <wangxuewu@.ecanyin.com> wrote in message
news:ehKKRxHzFHA.2720@.TK2MSFTNGP10.phx.gbl...
>I cannot insert data into MS SQL through ASP,but i can update it with asp
>program,so i need your help. Any sugestin will be hightly appreciated
>
> david
>|||Hi,
Verify:-
1. Run a profiler and get the actual insert statement
2. Exact error message; probably a
a. Previlage issue
b.Inserted columns miss match
c. Exclusive insert for an identity column
d. Prikary key violation
Thanks
Hari
SQL Server MVP
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OOVzbiJzFHA.2652@.TK2MSFTNGP14.phx.gbl...
> Good question David
> How do you think we can suggest you something without seeng your INSERT
> statement as well as an ERROR you are getting?
> Check out if the table has a trigger for INSERT.
>
> "msnews" <wangxuewu@.ecanyin.com> wrote in message
> news:ehKKRxHzFHA.2720@.TK2MSFTNGP10.phx.gbl...
>>I cannot insert data into MS SQL through ASP,but i can update it with asp
>>program,so i need your help. Any sugestin will be hightly appreciated
>>
>> david
>

Sunday, February 19, 2012

Hyde database features ...

My application setup program installs a MSDE2K instance on the user machine,
then attaches the application database (previously prepared with sa access
on the development machine), adds server logins and db users, sets
permissions etc. Everything goes fine, but I would like to hide my database
design, preventing the sysadmin of the target machine (NT) to view its
tables structure and relationships. How can I make my database protected 'by
itself' ?
hi Alessandro,
"Alessandro T" <alessandroteglia@.tin.it> ha scritto nel messaggio
news:ut2uAGWIEHA.3988@.tk2msftngp13.phx.gbl...
> My application setup program installs a MSDE2K instance on the user
machine,
> then attaches the application database (previously prepared with sa access
> on the development machine), adds server logins and db users, sets
> permissions etc. Everything goes fine, but I would like to hide my
database
> design, preventing the sysadmin of the target machine (NT) to view its
> tables structure and relationships. How can I make my database protected
'by
> itself' ?
>
it is not possible to prevent a sysadmin member to access your data and/or
metaschema ...
to prevent access to data area you have to resort to crypt solutions like
http://www.activecrypt.com/index.htm or your own algorithms, while for
schema hiding, you are only provided with the WITH ENCRYPTION option and for
stored procedure, views and user defined functions only...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.7.0 - DbaMgr ver 0.53.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply