Sql Operator(OR) Probelm

Apr 11, 2005

strsql = " select * from dic where english='" & SearchBox.Text Or TextBox4.Text & "'"The machine said Input string was not in a correct format. How can i select database with or operator in asp.net .Is it possible to select database in sql from more textbox ?

View 1 Replies


ADVERTISEMENT

Probelm With Transaction

Jun 7, 2005

hi,I wrote this sp :CREATE PROCEDURE ins_AddOrder( @CartId NVARCHAR(50), @CustomerId INT, @OrderDate DATETIME, @OrderId INT OUTPUT)AS
DECLARE @ins_error INT, @sel_error INT, @var_rowcount INT
BEGIN TRAN AddOrder
INSERT INTO tbl_orders( customerId, orderDate)VALUES( @CustomerId, @OrderDate)
-- SET THE @@ERROR VALUE TO @ins_errorSELECT @ins_error =@@ERROR
/*IF INS_ERROR != 0BEGIN ROLLBACK TRAN RETURNEND*/
SELECT  @OrderId = @@identity
INSERT INTO tbl_orderDetails( orderId, productId, quantity, productPrice)SELECT  @OrderId, tbl_product.productId, quantity, tbl_product.productPriceFROM tbl_shoppingCartINNER JOIN tbl_product ON tbl_shoppingCart.productId = tbl_product.productIdWHERE  cartId = @CartId
-- SET THE @@ERROR VALUE TO @sel_errorSELECT @sel_error = @@ERROR
-- SET THE @@ROWCOUNT TO @var_rowcountSELECT @var_rowcount = @@ROWCOUNT
IF  @sel_error <>  0  OR  @var_rowcount = 0 BEGIN  ROLLBACK TRAN AddOrder  RETURN ENDELSE BEGIN  EXEC del_EmptyShoppingCart @CartId  COMMIT TRAN AddOrder ENDGOIn the last few lines i try to prevent adding new row to tbl_orders (first statement), while the SELECT (second statement)  does not return any row .It still not work.Can anyone help please?thanks.

View 1 Replies View Related

SQL Trigger Probelm

Dec 1, 2005

I Have create a trigrer for my table transhd to update something in my detail table..

when i updated one record the trigger works fine..

but when i run command to update a batch of record in header
using command [update XXXX where cont] the trigger only fire for the last record in the batch..

is this the ms sql default behavior.. anyway to the around it

thanks in advance

View 1 Replies View Related

SQL Trigger Probelm

Dec 1, 2005

I Have create a trigrer for my table transhd to update something in my detail table..

when i updated one record the trigger works fine..

but when i run command to update a batch of record in header
using command [update XXXX where cont] the trigger only fire for the last record in the batch..

is this the ms sql default behavior.. anyway to the around it

thanks in advance

View 1 Replies View Related

Sql Login Probelm

Mar 19, 2004

I have a login in my sql server with windows authentication.When i tried to connet to the sql server with that login its not allowing me to connect even though I was logged on into my system.What should be the reason and what should i do?

View 2 Replies View Related

A Probelm With SqlConnection Command ....

Apr 19, 2005

I have met a problem in the ASP.NET project creation with SQL Server Database Connection.
"Can't Login to My ServerName/ASPNET
How to solve the problem?

View 1 Replies View Related

Probelm Accessing Sql Instance

May 31, 2006

Hi , I just put my files up on a web server. I can view my aspx pages..but when I try to login to the website I get the following;
An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Can you help? I can understand that it cannot find the specified instance of sql server, however I don't remember ever configuring it look to at a specific sql server. When i created the site in web dev express edition and added the login controls and set the asp config tool to use internet security it created the database itself and so I didn't have to put  a connection string in. I also cannot see a connection string in tthe web.config file.
The aspnetdb.mdf file is there on the server. is this something i need to configure with the hosting company or do i set it in my webconfig file.
Thanks

View 4 Replies View Related

Character Len Probelm With Executesql

Jun 15, 2007

I need to create some tables dynamically using sp_executesql. But the problem is the length of sql string is more the 4000 characters. How can I solve this problem?
Thanks

View 3 Replies View Related

Probelm In Installing Mysql On Win Xp M/c

Jul 20, 2005

hello ![color=blue]>>> I am trying to intstall Mysql binary version with installor in Windows> XP machine . But it is not working . i have installed in the default> path ,in windows service componenet its showing server is running,since> it is mysqld-nt so name-piped servr is also running.>> But still client is able to connect to server.>> when i am tring to instal manually it is showing>> " service already exists;> the currect server intstalled is c:mysqlinmysqld-nt.exe>> when trying to connect to server> C:> c:mysqlinmysql test> ERROR 2003 : cannot connect to MYSQL server on localhost <10061>>> C:> telnet localhost 3306> connecting to localhost.......> could not open connection to host,on port 3306No connection shb ne made> because the target machine actibvely refused it.>> plz help me in installing ,pls clarify the problem.> pls reply soon.>>> regards> Smita[/color]

View 1 Replies View Related

Probelm Using For Each Loop Container

May 18, 2007


We have a config table which has columns like pollingfolder, cop to folder etc.
Data looks like this
Config id polling folder
1 d:dataloadacn
2 d:dataloadship
under ACN and Ship folders we can have more than 1 source files which had to be loaded into target
the load process has to be repeated for each file in all the folders like ACN and ship
I have used for each loop container to poll the folder.
Can we set the directory to be polled at runtime taking from config table.
For doing this I have used the property Directory in expression editor of for each loop. But it is not working.
If I hard code the variable value in variables section , then its working.
How to change the directory to be polled value at runtime?

View 1 Replies View Related

Probelm With Export To Excel

May 15, 2008

I had installed SQL server 2005 4 bit version. I created on SSIS package through export wizard.

the SSIS packages will transfer data from database to Excel file. But it is giving the below error.

Message
Executed as user: XXXXXSYSTEM. ... Utility Version 9.00.3042.00 for 64-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 07:00:00 Error: 2008-05-14 07:00:00.51 Code: 0xC0202009 Source: Interface Connection manager "DestinationConnectionExcel" Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040154. An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered". End Error Error: 2008-05-14 07:00:00.51 Code: 0xC00291EC Source: Preparation SQL Task Execute SQL Task Description: Failed to acquire connection "DestinationConnectionExcel". Connection may not be configured correctly or you may not have the right permissions on this connection. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 07:00:00 Finished: 07:00:00 Elapsed: 0.344 seconds. The package execution failed. The step failed.


please any one guide me to reolve this issue.

View 4 Replies View Related

Probelm With Report Charts

Sep 20, 2007



I have two data sets but from the same data source. I created two different tables from these two data sets. Now I want to include a chart too. But When I insert the chart, it gives a erorr message.

The dinfinition of the report/my report name is invalid.
More than one data set, data region or grouping in the report has the name'chart1_seriesgroup1'. data set, data region and grouping names must be unique within a report.


Does any body know why this happen?

Thanks

View 3 Replies View Related

SQLDataSource Stored Procedure Probelm

Dec 16, 2005

Someone, please help me understand:
I have the following code:
Dim conString As String = ConfigurationManager.ConnectionStrings("WebAllianceConnectionString").ConnectionStringDim dsrc As New SqlDataSource()dsrc.ConnectionString = conStringdsrc.SelectCommandType = SqlDataSourceCommandType.StoredProceduredsrc.CancelSelectOnNullParameter = Falsedsrc.SelectCommand = "sp_GetCustomerInvoiceList"dsrc.SelectParameters.Clear()dsrc.SelectParameters.Add("@QueryType", "DATE")dsrc.SelectParameters.Add("@CustCode", "BAM7")dsrc.SelectParameters.Add("@OrdNumber", " ")dsrc.SelectParameters.Add("@InvStartDate", "1/1/2005")dsrc.SelectParameters.Add("@InvStopDate", "1/31/2005")dsrc.SelectParameters.Add("@PONumber", " ")Return dsrc.Select(DataSourceSelectArguments.Empty)
When this runs, it throws an exception:Prodecure or Function 'sp_GetCustomerInvoiceList' expects parameter '@QueryType', which was not supplied.
I'm confused... I clearly added that using the .Add method?What am I doing wrong?
 

View 5 Replies View Related

Probelm Restoring 2000sp1 To 2000 Not Sp1

Jul 3, 2001

has anyone had a problem restoring a SQL 2000 without sp1 to a SQL 2000 sp1 box or vice versa? I have had 2 failures telling me to call MS support in the message?

View 1 Replies View Related

Probelm With Extended Stored Procedure

Feb 17, 2004

Hi

Can i be able to use the DLL which is created in VB for Extended Stored Procedures.
if so how?

View 1 Replies View Related

Probelm With Global Variable DataType....need Help

May 30, 2007

hi everyone,
How do i declare a global variable in my package which takes a numeric value like User::VAR1 = 200402 and later on work on it

Later in the properties of the Dataflow i want to have this expression..

"select * from " + "TAB1" + " where Date=" + @[User::VAR1]

Here i want to subtract 190000 from @[User::VAR1] to get it in to myformat i.e the DATE format in the table


I can only see String datatype and othe datatypes wont allow me to to do any kind of manipulation in the expression:
and to be more specific what are
Int16
Int32
Int64
Double

I tried to use all of the above but the expression doesnt allow me as once i use any of the above it says :



TITLE: Microsoft Visual Studio
------------------------------

Nonfatal errors occurred while saving the package:
Error at Extract: The data types "DT_WSTR" and "DT_I8" are incompatible for binary operator "+". The operand types could not be implicitly cast into compatible types for the operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.


Any help would be appreciated..

thanks,
ravi

View 8 Replies View Related

Probelm With Connection To Databse Engine

May 21, 2007

Hi,



I have the same problem like Ben. Trying to connect to database engine but failed all the time. I use a SQL 2005 Enterprise Eval version. When I connect to database engine, I put <my computer name>SQLEXPRESS, it gives me this message:



An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (.Net SqlClient Data Provider)



I checked the sqlbrowser and it's running. I also enabled port 1434 in Firewall. But it still doesn't work. However, when I connect to analysis service using just <my computer name>, it lets me connected. I tried many ways to fix this problem but still no luck. Could anyone help me solve this problem please? Thanks so much.



Carl

View 6 Replies View Related

Invalid Operator For Data Type. Operator Equals Boolean AND, Type Equals Nvarchar

Jun 2, 2004

I get this error when I attempt to read from a datareader using the following sql statement:

Dim mysql As String = "SELECT PayrollTrans.PayrollID, Employees.[EmpFirstName] & ' ' & " _
& " Employees.[emplastname] AS FullName, Employees.[City] & ', ' & Employees.[State] & ' ' & Employees.[zip] AS CityState " _
& " , PayrollTrans.Date, PayrollTrans.EmployeeID, PayrollTrans.RegHours, " _
& " PayrollTrans.OTHours , PayrollTrans.RegPay, PayrollTrans.OTPay, " _
& " PayrollTrans.FedTax, PayrollTrans.FICATax, PayrollTrans.MedicareTax, " _
& " PayrollTrans.ESCTax, PayrollTrans.StateTax, PayrollTrans.ESCEMPTax, " _
& " PayrollTrans.FUTATax, PayrollTrans.NetPay, Employees.EmployeeID, " _
& " Employees.Address1, Employees.Address2, Employees.SSAN, " _
& " Employees.PayType, Employees.RegPayRate, Employees.OTPayRate, " _
& " Employees.MaritalStatus, Employees.FedExemption, Employees.StateExemption, " _
& " Employees.Active, Employees.SelectforPay, Employees.PayDate " _
& " FROM PayrollTrans, Employees where PayrollTrans.EmployeeID = Employees.EmployeeID;"

my reader command list as follows:

Dim objCM As New SqlClient.SqlCommand(mysql, SqlConnection1)
Dim objDR As SqlClient.SqlDataReader
objDR = objCM.ExecuteReader


Any ideas on where I am going wrong?

Thanks in advance

View 3 Replies View Related

Invalid Operator For Data Type. Operator Equals Boolean AND, Type Equals Datetime.

May 18, 2004

I am getting a error message saying: Invalid operator for data type. Operator equals boolean AND, type equals datetime.

I traced the pointer to @gdo and @gd, they are both dates!

INSERT INTO AdminAlerts values (CURRENT_USER, 'UPDATE', getDate(), @biui, 'Updated booking, ID of booking updated: ' & @biui & ', Booking date and time before/after update: ' & @gdo & '/' & @gd & ', Room number before/after update: ' & @rno & '/' & @rn & ' and Customer ID before/after update: ' & @cio & '/' & @ci)


If I cut that two dates out it works fine.
Could someone tell me the syntax to include a date in a string :confused:

View 3 Replies View Related

SQL LIKE Operator And %

Jan 14, 2008

Just a quick question that I really couldn't find using google or anything because it was too bland.
How do you return the whole database while still using the LIKE operator.
I have a textbox that you can use to search the database but I want all the data to be displayed underneath the box so you can "browse" the data if you don't know the name of what you are looking for.
What would I put as the default value?  I used just defaultvalue="%" and that worked in 1 area, but not another.  Is this the right way?
Thanks,
Chris

View 4 Replies View Related

SQL AND/OR Operator

Apr 30, 2008

I have a query and for the life of me I cant figure it out.
I have a web form with a number of textboxes on it e.g. Title, subtitle, isbn. I also have a search button. This search page allows a user to enter any combination of fields in the form and then when they click the search button, a datagrid is diaplyed showing the results (gets the results from a SQL DB).
 I have got the code working if the user selects say one item, but I dont know how to allow it so that the user can enter any combination of items in the form and the search button will search for it based on what the user says. I think im gettng confused with my logical operators in the sql statement.
If any one can take a look I would be greatful.public void BindData(){String @BookID = TxtBookID.Text;String @Title = TxtTitle.Text;String @Subtitle = TxtSubtitle.Text;String @ISBN = TxtISBN.Text;String @AuthorFName = TxtForename.Text;String @AuthorLName = TxtSurname.Text;
SqlDataAdapter ad = new SqlDataAdapter("SELECT Book_ID_Internal, Title, Subtitle, ISBN, Edition, Publication_Date, Author.First_Name, Author.Last_Name FROM Book, Author WHERE Book.Author_ID = Author.Author_ID AND Book.Book_ID_Internal = '" + @BookID + "' AND Book.Title = '" + @Title + "' AND Book.Subtitle = '" + @Subtitle + "' AND Book.ISBN = '" + @ISBN + "' AND Author.First_Name = '" + @AuthorFName + "' AND Author.Last_Name = '" + @AuthorLName + "'", conn);DataSet ds = new DataSet();ad.Fill(ds, "Book");GridView1.DataSource = ds;GridView1.DataBind();}
protected void BtnSearch_Click(object sender, ImageClickEventArgs e){BindData();}

View 6 Replies View Related

LIKE Operator ..???

Jun 1, 2004

Hi :)

I have a select statement that consists on something like this :

SELECT * FROM Products WHERE Ref LIKE '%" & Search & "%'

well this works ....but the problem is that i have some Ref in this format "MC-909" and if the user makes a search with the word "MC909" ...it dosent return any value ...

How can i solve this ??

Thanks in advance

View 4 Replies View Related

IN Operator

Nov 19, 2001

Anyone know why this simple query won't work??

this does work:

declare @stat char(10)
set @stat = 'A'
select * from table where status in (@stat)

this does not work:

declare @stat char(10)
set @stat = "'A','B'"
select * from table where status in (@stat)

i've tried 'A,B'

View 3 Replies View Related

Using Like % Operator

Apr 23, 2007

hello,

I got a condition in the query , as shown below:

where nt.Project_type='A' and nt.status='Done' and nt.project_id like '06%'

I also need to add an additional condition : like '07%'. How can I do this, i. e I need the projects where the type = A , status = Done and project_id starting with 06 and 07.

Thanks for any help

View 4 Replies View Related

LIKE AND OR OPERATOR

Jun 16, 2007

Hi ,
This is my first message on this forum. Well, I want to write a query which finds the length of the employee names whose name starts with J, A or S?.

This is what I did:

SELECT LENGTH(ENAME) FROM EMP
WHERE ENAME LIKE 'A%' OR LIKE 'J%' OR LIKE 'S%'

This query does not work. Can anyone tell me what is wrong with it?

Thanks,

View 3 Replies View Related

Like Operator

Feb 2, 2008

Using Like operator

I want to display Names ending with XYZ. But, the starting letter should be either A, B OR C.

Example:

AXYZ
BXYZ
CXYZ


Tell me how to do that

Thanks in Advance

View 3 Replies View Related

Like Operator

Feb 14, 2008

I have a column named tags which contains tagnames seperated by commas now i have to compare this column with a parameter named tagname which contains a single tagname how to do this.Please help me

here is my procedure

ALTER PROCEDURE [dbo].[ProcSoftwaresGetSoftwaresbyTags]
(
@FileTag Varchar(64)
)
AS
BEGIN

SELECT Category.CategoryName, Softwares.SoftwareFileID, Softwares.CategoryID, Softwares.FileName, Softwares.FileImage,Softwares.FilePath, Softwares.FilePublisher,
Softwares.Adminrating, Softwares.FileDownloadCount,substring(Softwares.FileDescription,1,200)as FileDescription,convert(Varchar(12),Softwares.FilePostedDate,109)as FilePostedDate,Softwares.FileSize, SystemRequirements.OperatingSystem
FROM Category INNER JOIN
Softwares ON Category.CategoryID = Softwares.CategoryID INNER JOIN
SystemRequirements ON Softwares.SoftwareFileID = SystemRequirements.SoftwareRequirementID where substring(Softwares.FileTag,0,3) LIKE substring(@FileTag,0,3) and FileStatus=1
END

View 5 Replies View Related

EXCEPT Operator

Jun 6, 2006

Hello everyone,

I have two tables athat are structurally identical.  I wish to obtain rows that are in the first table that are not in the second one (e.g. the EXCEPT operator). EXCEPT is not supported directly in TSQL...

Does anyone know how to do this??!?!?

 Thank you for your time

Chris

View 3 Replies View Related

Like Operator

Sep 25, 2006



Hi,

Can you just tell me how to use LIKE Operator(Syntax) please.I am new to SSRS2005.





View 8 Replies View Related

Between Operator

Jun 6, 2006

Hi,

I'm having problems using the between operator in a query statement.

Select *
from <mytable>
where date between @date1 and @date2

The date values with a hour specified, aren't returned. What is the approach you would recommend here? 

Thx

EDIT: by playing with this problem I've figured out I can append the hour to the date like this: <date> between @fromDate + '00:00:00' and @toDate + '23:59:59'

this seem to work, but I'm not sure if this is correct

View 5 Replies View Related

Dynamic Operator Help

Jun 18, 2007

Hi,
I'm trying to build a form that will allow users to choose their own parameters for the Select statement in the SqlDataSource. These results would then be displayed back to a GridView control. The only problem I am having is figuring out how to allow them to choose the operator (=, <, >, <>, etc) from a dropdown list. Does anyone have any suggestions on how to do this with a SqlDataSource control? It is probably something simple and any help would be much appreciated.
Thanks

View 6 Replies View Related

Limiting And Using The TOP Operator

May 31, 2004

Hi,

please do help. Have been wrestling with this for about 3 hours and read a buncha forums + searched the tutorial lists.. AARRGH!

Anyhow,

I have to paginate a datalist (and I really can't use a datagrid because of the layout, blame the bluddy graphic designer)

I want to return the top 8 rows, the next 8 top rows and so on.

This is the sql string I have:
'retrieve pagination in order to construct the rest of the sql string
Dim startrec As Integer
If pageno = 1 Then
startrec = 0
Else
startrec = (pageno - 1) * pagesize
End If
' this builds the sql string, getting ONLY the records we need for this. Page size is a constant expressed on the base page
' startrec is the record where I want to start in the db.
strsql = "select top " & pagesize & " * " & strsqlbasic & " and itemID>" & startrec & " order by itemnotes1 asc"
noresults.text = strsql & " <br> " & searchwhat & searchfor

strsqlbasic is constructed elsewhere and is just the 'from X where y = var

Of course, this returns all records where the value of itemID is greater than the value of startrec. How would I change this so it returns the next 4 rows starting from the row number given by the value of startrec?

thanks for any help.

View 3 Replies View Related

Help Me Please, About Operator Tree

Jan 3, 2006

Consider the following SQL query:
SELECT ENAME,SAL
FROM EMP,ASG,PAY,PROJ
WHERE EMP.ENO=ASG.ENO
AND PAY.TITLE=EMP.TITLE
AND ASG.PNO=PROJ.PNO
AND ASG.DUR=48 AND BUDGET>200000
Give the possible operator trees:right-deep,left-deep and bush
Tank you very much!

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved