|
Try this:
<code>string optionalFiters="";
if(TxtFname.Text!="")
optionalFiters+=" and First_Name= '" & TxtFname.Text + "'";
if(TxtLname.Text!="")
optionalFiters+=" and Last_Name= '" & TxtLname.Text + "'";
if(DpdownSex.SelectedItem.Text!="")
optionalFiters+=" and Sex= '" & DpdownSex.SelectedItem.Text + "'";
</code>
Query:
<code>"select * from Cand_Information where Category= '" & DpCat.SelectedItem.Text & "'" & optionalFiters
</code>
Regards,
Arun Kumar.A
|
|
|
|
|
Please tell me how to insert a string like this: SAMPLE'STRING into an SQL table? How escape special characters in MSSQL?
Thank you.
--------------------------------
visit: http://pmartike.deviantart.com/
|
|
|
|
|
Problem solved
--------------------------------
visit: http://pmartike.deviantart.com/
|
|
|
|
|
I have a Classic ASP website and i want to use MS SQL Express edition as the datasource. I tried the .NET Connectionstring and they do not work for the Classic ASP (ADO) site. I have tried figuring this out for the last three days. PLEASE HELP! Thanks in advance.
|
|
|
|
|
What kind of messages are you getting, if any?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Here is the connection string im using:
Data Source=.\SQLEXPRESS; Integrated Security=True;AttachDbFilename=|DataDirectory|\MyDatabase.mdf;Initial Catalog=MyDatabase
This is the error:
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
|
|
|
|
|
|
Okay I changed my ConnectionString to:
Provider=SQLNCLI;Server=localhost\SQLExpress;Database=data.mdf;
I now get a new Error:
Invalid authorization specification.
I do not have a username or password on the file. Now what??
|
|
|
|
|
It should be:
Provider=SQLNCLI;Server=.\SQLExpress;AttachDbFilename=FullyQualifiedPathToDBFile.mdf;Database=dbname;Trusted_Connection=Yes;"
This will only work for code executed server-side. It won't work for client-side code.
|
|
|
|
|
This CS did the trick. Thanks
|
|
|
|
|
please read the forum guidelines.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Dang. You beat me to it. Just saw the cross post in the other forum and wondered where I saw it before.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
leckey wrote: Flea Market! It's just like...it's just like...A MINI-MALL!
What happened to cats and awesome.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Hi,
How can i create hash clustered index in oracle?
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language, so please don't mind if i do some grammatical or spelling mistakes in my messages."
|
|
|
|
|
Have you looked around in the Oracle forums?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
hi friends
this is my stored procedure:
CREATE procedure dbo.sp_ins_logo
@companyname varchar(120),
@country varchar(80),
@url varchar(150),
@category varchar(80),
@description varchar(250),
@picturepath varchar(80),
@picturetype char(5),
@status int,
@ins_status varchar(10) output,
@lcode varchar(10) output
as
set nocount on
begin transaction
declare @logo_rowid decimal
declare @logo_code varchar(10)
declare @logo_rowcount decimal
declare @max_logoid decimal
declare @logo_codepfix char(3)
set @logo_codepfix='LGO'
select @logo_rowcount= (select count(*) from dbo.tbladdlogos1)
if @logo_rowcount = 0
begin
select @logo_rowid = 1
select @logo_code = @logo_codepfix + convert(varchar(5),@logo_rowid)
end
else
begin
select @max_logoid = (select max(row_id) from dbo.tbladdlogos1)
set @logo_rowid = @max_logoid + 1
set @logo_code = @logo_codepfix + convert(varchar(5),@logo_rowid)
end
declare @file_name varchar(80)
set @file_name = @picturepath + @logo_code + '.' + @picturetype
if not exists (select companyname from dbo.tbladdlogos1 where url = @url)
begin
if not exists (select companyname from dbo.tbladdlogos1 where companyname = @companyname)
begin
insert into dbo.tbladdlogos1 values(@logo_rowid,@logo_code,@companyname,@country,@url,@category,@description,@file_name,@status)
declare @ER as int
select @ER = @@error
if @ER <> 0
begin
set @ins_status='Failure'
set @lcode=@logo_code
end
else
begin
set @ins_status='Success'
set @lcode=@logo_code
end
end
end
commit
GO
this is my table
CREATE TABLE [tbladdlogos1] (
[row_id] [int] NOT NULL ,
[logo_code] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[companyname ] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[country] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[url] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[category] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[description] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[picturepath] [varchar] (300) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[status] [int] NULL
) ON [PRIMARY]
GO
i inserted value
below error is occured
Invalid object name 'dbo.tbladdlogos1'. Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1.
can u help me
regards
saravanan
|
|
|
|
|
First, check that you're executing the above in the right database, or that you created the table in the right database. We've all done it.
Second, you've used BEGIN TRANSACTION in the above code, but you didn't tell SQL Server what you wanted to happen at the end. You should use COMMIT TRANSACTION to save the changes you've made, or ROLLBACK TRANSACTION to discard them. Generally you should check @@ERROR after every data modification statement and ROLLBACK TRANSACTION (and return) if it's not 0. Only critical errors abort the stored procedure and automatically rollback the transaction. Errors like attempting to insert a duplicate key are not considered critical; the statement will be aborted and rolled back, but execution will continue at the next statement.
SQL Server does not permit transactions opened in a stored procedure to be held open after that procedure executes. That's why you get the error. If you want a transaction to span multiple procedure calls, you'll have to use a client-side transaction (e.g. a SqlTransaction object).
|
|
|
|
|
...and in addition to that, make sure you have granted access to the user that you are when executing the call.
Tom Garth
Developer
R. L. Nelson and Associates, Inc., Virginia
|
|
|
|
|
Hi,
How to refer one .RDL file created in one project(Proj1) in another project(Proj2) in the same solution in SQLServer Reporting Service(SSRS).
I am not able to refer .rdl file created in one project in another project under same solution.
Karuna
|
|
|
|
|
Have you tried including a reference to it in the solution?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
First of all Thanks for your reply.
Here, thats what the problem in this SSRS Solution. we cannot include any refernce in the project as we do in normal visual studiao IDE.only we can add Data sources and .RDL files physically.But we cannot refer any .rdl file logically as we do with dlls.
Thanks.
Karuna
|
|
|
|
|
Hi,
How to create a new folder in SQLServer Reporting Services(SSRS) Project?
If i create an SSRS project, the solution comes with two folders 'Shared Data Sources' and 'Reports' by default. But i am not able to add a new folder under that solution.
Karuna
|
|
|
|
|
|
Hi,
I am trying to clarify a doubt. Can we use Views for a insert Query?
Thanks in advance,
Sunil Nair
|
|
|
|
|
Yes, inserting into a base table from a view is possible.
however all not null columns to be included in the view
and any columns with check constraint
Regards
KP
|
|
|
|