Showing posts with label facing. Show all posts
Showing posts with label facing. Show all posts

Friday, March 30, 2012

Problem in inserting binary data in sql;

Hi,

I am facing problem inserting binary data into sql data type varbinary.

I want to save an object data type in var binary data type into sql.It gives a followin error.

The name 'DocumentData' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.

I do not use ASP Upload file.

Any type of help .

Thanks in advance

Friend

Hello my friend,

The variable is not being passed to the SQL correctly. For example: -

INSERT INTO tblCountry (CountryName) VALUES ('Italy') - this is fine

INSERT INTO tblCountry (CountryName) VALUES (Italy) - not right because single quotes are missing. However, SQL thinks I am referring to a column name when I say Italy. Check your SQL.

Kind regards

Scotty

|||

Hi,

Thanks for your reply.Follwoing is my code plz review and help me if i am making any mistake.

query =

"Insert into Documents(DocumentID,DocumentName,DocumentData,DocumentType,FileID,Field1,Field2,Field3,Field4)values (@.DocumentID,@.DocumentName,DocumentData,DocumentType,FileID,Field1,Field2,Field3,Field4,)";

sc.Parameters.Add(

"@.DocumentID",SqlDbType.Int, 10);

sc.Parameters.Add(

"@.DocumentName",SqlDbType.VarChar, 15);

sc.Parameters.Add(

"@.DocumentData",SqlDbType.Binary, 15);

sc.Parameters.Add(

"@.DocumentType",SqlDbType.VarChar, 10);

sc.Parameters.Add(

"@.FileID",SqlDbType.Int, 10);

sc.Parameters.Add(

"@.Field1",SqlDbType.VarChar, 15);

sc.Parameters.Add(

"@.Field2",SqlDbType.VarChar, 15);

sc.Parameters.Add(

"@.Field3",SqlDbType.VarChar, 15);

sc.Parameters.Add(

"@.Field4",SqlDbType.VarChar, 15);

sc.Parameters[

"@.DocumentID"].Value = documentid;

sc.Parameters[

"@.DocumentName"].Value = docname;

sc.Parameters[

"@.documentData"].Value=fileimg;

sc.Parameters[

"@.documentType"].Value = doctype;

sc.Parameters[

"@.FileId"].Value = fileid;

sc.Parameters[

"@.Field1"].Value = f1;

sc.Parameters[

"@.Field2"].Value = f2;

sc.Parameters[

"@.Field3"].Value = f3;

sc.Parameters[

"@.Field4"].Value = f4;

sc.CommandText = query;

sc.ExecuteNonQuery();

|||

Hello again my friend,

I see it now. You are missing the @. symbols within the insert statement at the top of your code for every parameter after @.DocumentName. Besides this, have a space between ) and values. Also, you need to take out the comma after Field4 at the end of the values group so it ends in a bracket, not a comma with a bracket. I amend it as follows: -

query ="Insert into Documents (DocumentID,DocumentName,DocumentData,DocumentType,FileID,Field1,Field2,Field3,Field4) values (@.DocumentID,@.DocumentName, @.DocumentData, @.DocumentType, @.FileID, @.Field1, @.Field2, @.Field3, @.Field4)";

Kind regards

Scotty

|||

Hi,

Thanks, thank you very much..

Best Regards,

Adnan

Problem in exporting Report with multiline textbox to Excel

Hi,

I am facing a problem while exporting reports to Excel.
My report contains a multilined textbox - which is displayed correctly in Report Design.

Following is code of report Statistics contents to be displayed in a textbox: ="Report Statistics " & vbcrlf & "Date : " & Format(Globals!ExecutionTime, "MMM dd yyyy tt”) & vbcrlf & "By : " & User!UserID

Problem Description: In Excel - one extra line is added between each line

Sample output of report exported in Ms Excel 2003:

Report Statistics

Date : Jun 12 2006

Time : 6:53:23 PM

By : COMPANY\EMP ID

Correct Output Required:

Report Statistics

Date : Jun 12 2006

Time : 6:53:23 PM

By : SERWIZSOL\P97006

Configuration:
Microsoft SQL Server 2000 SP3
Microsoft SQL Reporting Services 2000 SP2

If some one is facing similar problem or knows the solution, please let me know.

Thanks in Advance.
Regards,
Abhijeet

Hi Abhijeet,

I tried your expression ="Report Statistics " & vbcrlf & "Date : " & Format(Globals!ExecutionTime,"MMM dd yyyy tt") & vbcrlf & "By : " & User!UserID

Everything worked fine for me. I added a text box and set the expression to above text and it works perfectly. Was there anything else you were doing?

Wednesday, March 28, 2012

Problem in deployment of Crystal 10 with VB6

I've facing problem in creating the package for the application using VB6 and Crystal reports 10. What are the support files needed to be included in the package. I've already included Crviewer.dll,CRAXDRT.dll. But there is no response in the client machine.Whether Crystal Reports 10 need to be installed in client machine?

Please respond!

Thanking you,

Regards,
Rajarajan RI found solution to my deployment problems in the next link -->

http://support.businessobjects.com/communityCS/TechnicalPapers/rdc10_deployment.pdf

Problem in Database Restore

Hi
I am facing the following issue when trying to restore a database from a log
in that has 'dbcreator' role.
While restore, i get the following error :
'Processed 104 pages for database 'Testsql', file 'TestSQL_Data' on file 1.
Processed 1 pages for database 'Testsql', file 'TestSQL_Log' on file 1.
Server: Msg 916, Level 14, State 1, Line 1
Server user 'TestSQl' is not a valid user in database 'Testsql'.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.'
If i login with a role of 'sysadmin', i find that the data has been restored
completely
but the link with the login and sysusers in the database has been broken.
The problem is that, i don't have the sysadmin role in the production server
and i have to restore my database with the 'dbcreator' role only.
Should i have the 'sysadmin' role for database restore to be complete?
With Thanks,
Jeyalakshmi.b> If i login with a role of 'sysadmin', i find that the data has been
restored completely
> but the link with the login and sysusers in the database has been broken.
This is normal when restoring/attaching a database from another server. You
can resync logins and users with sp_change_users_login. See the Books
Online <"tsqlref.chm::/ts_sp_ca-cz_8qzy.htm"> for details.

> The problem is that, i don't have the sysadmin role in the production
server
> and i have to restore my database with the 'dbcreator' role only.
>
To restore the database with only dbcreator, the login either needs to be
the original database owner or a user in the source database. Also, the
login's SID needs to be the same on both servers. The SID will be always be
the same on both servers with Windows authentication but not with SQL
authentication. With SQL authentication, you can specify the desired SQL
login SID with the sp_addlogin @.sid parameter.

> Should i have the 'sysadmin' role for database restore to be complete?
Restores are bit easier with sysadmin role membership since you don't have
sync the dbcreator login on both servers. However, it's not a requirement
to be a sysadmin role member as described above.
Hope this helps.
Dan Guzman
SQL Server MVP
"Jeyalakshmi" <anonymous@.discussions.microsoft.com> wrote in message
news:5D0837F5-2FB5-4899-89A4-B4FDA2B33F47@.microsoft.com...
> Hi
> I am facing the following issue when trying to restore a database from a
login that has 'dbcreator' role.
> While restore, i get the following error :
> 'Processed 104 pages for database 'Testsql', file 'TestSQL_Data' on file
1.
> Processed 1 pages for database 'Testsql', file 'TestSQL_Log' on file 1.
> Server: Msg 916, Level 14, State 1, Line 1
> Server user 'TestSQl' is not a valid user in database 'Testsql'.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.'
> If i login with a role of 'sysadmin', i find that the data has been
restored completely
> but the link with the login and sysusers in the database has been broken.
> The problem is that, i don't have the sysadmin role in the production
server
> and i have to restore my database with the 'dbcreator' role only.
> Should i have the 'sysadmin' role for database restore to be complete?
> With Thanks,
> Jeyalakshmi.b
>
>
>
>

Monday, March 26, 2012

Problem in connecting to SSAS

I'm facing some security when deploying SSAS and reports using Reporting Services. In my environment, I don't understand why I can access the SSAS via the management studio if I don't have the domain administrator right. The support team have granted this right to me for development purpose.
In the connection dialog of Management Studio, I can only choose Server name after I click Connect --> Analysis Services. The authentication type is dimmed out by default. Please gives me some more relevant links to setup properly.
After deployed my cubes and reports, the other user cannot view the reports as they can't access the SSAS database. What should I do? There're so many security setting and I don't know which one I should tune. Thanks in advance.

Hello! You do not need to be an domain adminstrator in order to access Reporting Services and Analysis Services. It is sufficient to be a local administrator on the server running these two applications.

In Reporting Services you have the option to run a report with windows authentication or an assigned account for Reporting Services access to Analysis Services.

If you run with the first option each user need to mapped to a role in Analysis Services which can be done with individual accounts or windows groups. For the second option it is only the Reporting Services(AS2005) account that needs to mapped to a role in Analysis Services.

You can do this both in BIDS, Report Manager or Management Studio.

This is true for a server where both these applications are running. If Reporting Services is on a separate server things are a little bit more complicated. In this case you will have to set up account delegation in Active Directory. The key word for this setup is 'Kerberos' .

HTH

Thomas Ivarsson

|||Can you give me some more detail on the configuration please? Are there any guides available on the web? Thanks!|||

Hello! I have not found any best official practices regarding SSRS2005 and SSAS2005 integration.

My advice is based on customer cases/practises that I have used and some good writing in a reporting services book.

Regards

Thomas Ivarsson

|||http://technet.microsoft.com/en-us/library/ms175386(SQL.90).aspx

This website provides what I needed.

Problem in connecting to SSAS

I'm facing some security when deploying SSAS and reports using Reporting Services. In my environment, I don't understand why I can access the SSAS via the management studio if I don't have the domain administrator right. The support team have granted this right to me for development purpose.
In the connection dialog of Management Studio, I can only choose Server name after I click Connect --> Analysis Services. The authentication type is dimmed out by default. Please gives me some more relevant links to setup properly.
After deployed my cubes and reports, the other user cannot view the reports as they can't access the SSAS database. What should I do? There're so many security setting and I don't know which one I should tune. Thanks in advance.

Hello! You do not need to be an domain adminstrator in order to access Reporting Services and Analysis Services. It is sufficient to be a local administrator on the server running these two applications.

In Reporting Services you have the option to run a report with windows authentication or an assigned account for Reporting Services access to Analysis Services.

If you run with the first option each user need to mapped to a role in Analysis Services which can be done with individual accounts or windows groups. For the second option it is only the Reporting Services(AS2005) account that needs to mapped to a role in Analysis Services.

You can do this both in BIDS, Report Manager or Management Studio.

This is true for a server where both these applications are running. If Reporting Services is on a separate server things are a little bit more complicated. In this case you will have to set up account delegation in Active Directory. The key word for this setup is 'Kerberos' .

HTH

Thomas Ivarsson

|||Can you give me some more detail on the configuration please? Are there any guides available on the web? Thanks!|||

Hello! I have not found any best official practices regarding SSRS2005 and SSAS2005 integration.

My advice is based on customer cases/practises that I have used and some good writing in a reporting services book.

Regards

Thomas Ivarsson

|||http://technet.microsoft.com/en-us/library/ms175386(SQL.90).aspx

This website provides what I needed.sql

Friday, March 23, 2012

Problem in attaching database

Hi all,
I am facing a problem during attaching a database (.mdf and .ldf files are copied fro another server). the message I am getting as follows:

messages was from 'Microsoft SQL Server Management Studio Express':

===================================

Attach database failed for Server 'CTPL-1'. (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.Exceptio nTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

----------
Program Location:

at Microsoft.SqlServer.Management.Smo.Server.AttachDa tabase(String name, StringCollection files, String owner)
at Microsoft.SqlServer.Management.SqlManagerUI.Attach DatabaseData.PrimaryFile.Attach()
at Microsoft.SqlServer.Management.SqlManagerUI.Attach Database.SendDataToServer()

===================================

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)

----------
Program Location:

at Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Smo.ExecutionManage r.ExecuteNonQuery(StringCollection queries)
at Microsoft.SqlServer.Management.Smo.Server.AttachDa tabaseWorker(String name, StringCollection files, String owner, AttachOptions attachOptions)
at Microsoft.SqlServer.Management.Smo.Server.AttachDa tabase(String name, StringCollection files, String owner)

===================================

Could not find row in sysindexes for database ID 8, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'mci'. CREATE DATABASE is aborted. (.Net SqlClient Data Provider)

----------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=602&LinkId=20476

----------
Server Name: (local)
Error Number: 602
Severity: 21
State: 50
Line Number: 1

----------
Program Location:

at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQuer yTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNo nQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)

===============================================


********************************

the followings are the command and mesage from Query Analyzer:

*****************************************

command:

-- =============================================
-- Attach database via sp_attach_db
-- =============================================
EXECUTE sp_attach_db @.dbname = N'mci',
@.filename1 = N'd:\ifgl\database\mci.mdf',
@.filename2 = N'd:\ifgl\database\mci_log.ldf'
GO

*****************************************

message:

Server: Msg 602, Level 21, State 50, Line 1
Could not find row in sysindexes for database ID 8, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.

Connection Broken

*******************************************

I am new to MS SQL Server and unable to solve the problem. Can anyone help me in this metter.

Thanks in advance.Can anybody give some quick solution to the above problem?|||I am guessing that you just copied the mdf/ldf without actually detaching first. In that case the mdf and ldf will be invalid.

I would suggest restoring from a backup rather than doing the detach/attach thing.