.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

use question mark in search representing exactly one character - possible?

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :ASP.Net
 

Hi,

Is there way to use the question mark ? in MS SQL Search Expression? Like so:

SELECT [Name] FROM [dbo].[Users] WHERE [Name] = "M?yers"

The ? stands for exactly 1 character. I tried LIKE

SELECT [Name] FROM [dbo].[Users] WHERE [Name] LIKE "M%yers"

but the % represents 0 or more characters!

Thanx for help,

S.




View Complete Post


More Related Resource Links

Geometry Search Question

  
Hello Group, I am have a column of gemetry type in my sql server 2008 database.  I stored POINT data there IE( POINT(23.989899, 21.090909).  I have a parameter page in which I allow users to put a range on the latitude and longitude. My question is, how can I use those parameters in a where clause to limits the records that come back based upon what the user enters? I have seen examples for most geometric data types but nothing for POINTs.  For example, if the user enters in a latitude of greater than 10.010101 and a longitude of 45.999999, I want to return all the records containing lats > 10.010101 and longs greater 45.999999..... I have tried several solutions with nothing working so far... Any ideas? thanks.  

How to read string end with question mark in regular expression?

  
Hello, I'm facing problem when I read string which is ended by question mark. I use in my code as the following. \"?(?<myfield>[^\"]?.*[^\"?]?)\"? If string is ended by question mark, it's not working. Please help me to solve my problem. Thanks. Co Coe

Text Search Strategy Question for the SSIS Gurus...

  
BACKGROUND: As I have mentioned in some of my other posts I am using SSIS 2005 to replace an existing MS Access 2003 / VBA based ETL engine which I developed some years back.   Part of my existing Access-based ETL performs a text search of the source records and I am now attempting to replicate that functionality in SSIS (replicate in terms of the end-result and not necessarily the methods used to get to that end result).  I have an idea of how I plan to go about this but since am relatively new to SSIS so would greatly appreciate the feedback of those more experienced... DETAILED DESCRIPTION: In the source (Sybase ASE15) database, there is an "object" table (not the actual table name but for illustrative purposes it will suffice).  Within the object table there is a "description" column which is a char(60) datatype.  The description column simply represents a description of the object as defined by the source system end-user. For my ETL solution I allow the ETL administrator to define one or many (1...n) key words or phrases which represent search criteria.  These search criteria are stored in a reference table in my target SQL Server 2005 database (the same database to which my ETL will transform results and store them).  My objective, is as follows:  For each of the 1...n search criteria defined, try and find th

Search field question

  
hi guysin my database i have one table that has basic patient information (id,name,dob etc, visit date etc)i would like for the user to be able to search for a patient based on his unique personal id number and return the fields i specify (name,lastname) in the gridview. my problem in that one patient may have multiple visit dates. i would like the gridview to return the following as an exampleName     Lastname   Visit dateJoe         Johnson      10/05/10Joe         Johnson      13/08/10joe         Johnson       20/09/10from that the user will be able to click on the visit date that he wants to see the details aboutmy problem in that since the user ID is a unique field in my table i dont know how to create multiple visit dates. i think i should put the visit date in a different table and create a relationship but then i dont know how to present details from 2 tables in one gridviewthank you

SharePoint 2007 Enterprise Search Scope Question

  

Hello,

I have configured different search scopes to point to different search contents on my MOSS server and had them displayed on cope dropdown menu.  Everything is working great but with one issue; the selected scope from the default Search page does not stick on the Result page.

For example, I have three scope choices available on my scope dropdown menu: scope1, scope2, and scope3.  For this particular scope Display Group, I have selected "scope1" to be the default.  So when I go to the main Search page, "scope1" is shown as the default choice on the scope dropdown menu.  If I select another scope from the dropdown menu (e.g., scope2) and perform a search, it takes me to the Result page showing the result of the search and also shows what I typed in in the search text box.  The problem is that although I selected "scope2" on the original page's dropdown menu, the result page's dropdown menu shows "scope1" which is the default choice and not what I selected on the original page.  This behavior is confusing to my end users who want to refine their search from the Result page but then they have to re-select "scope2" from the dropdown menu.

My question is, is there a way for me to make the selected scope choice from the original page to stick on the Result page's s

SharePoint 2007 Enterprise Search Scope Question

  

Hello,

I have configured different search scopes to point to different search contents on my MOSS server and had them displayed on cope dropdown menu.  Everything is working great but with one issue; the selected scope from the default Search page does not stick on the Result page.

For example, I have three scope choices available on my scope dropdown menu: scope1, scope2, and scope3.  For this particular scope Display Group, I have selected "scope1" to be the default.  So when I go to the main Search page, "scope1" is shown as the default choice on the scope dropdown menu.  If I select another scope from the dropdown menu (e.g., scope2) and perform a search, it takes me to the Result page showing the result of the search and also shows what I typed in in the search text box.  The problem is that although I selected "scope2" on the original page's dropdown menu, the result page's dropdown menu shows "scope1" which is the default choice and not what I selected on the original page.  This behavior is confusing to my end users who want to refine their search from the Result page but then they have to re-select "scope2" from the dropdown menu.

My question is, is there a way for me to make the selected scope choice from the original page to stick on the Result page's s

Line 1: Incorrect syntax near ','. Unclosed quotation mark before the character ...

  

Can someone please review my code and see where I can be missing information. I get the following error:

Line 1: Incorrect syntax near ','. Unclosed quotation mark before the character string ' )'. 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 _Default.SaveToDatabase(String SavePath) in C:\Inetpub\wwwroot\Webfile1\Default.aspx.vb:line 78


Imports System.IO
Imports System.Data
Imports System.Data.SqlClient
Partial Class _Default
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
    Protected Sub Submit1_Click(ByVal sender

Unclosed quotation mark after the character string '

  

insert into quality_assurance (person_id, last_name) values ('"+id.text+"','"+last_name.text+"')

id.text and last_name.text are fields in our specialized scanning application and that's how you would extract the values in them to pass them into a sql server query.

The challenge now is that when the last_name.text = a name with a single quote, I get the error above "Unclosed quotation mark after the character string ' "

Any ideas?

 

 


SSRS 2005 export to csv has question mark in place of sterling currency symbol

  

Hi,

I've upgraded reports from SSRS 2000 to 2005, and since then when I export to csv I get a question mark wherever there ought to be a sterling currency symbol. The table cell in the report is formatted correctly and when exporting to xls the currency symbol is preserved. One of my users requires the data as csv.

Can anyone help with this?

Thanks.


Louise

Unclosed quotation mark after the character string ')

  
Hi,


I am getting the error "Unclosed quotation mark after the character string ')" with this code:

Code Snippet

cmd = New SqlCommand("INSERT INTO PRODUCT VALUES ('" & Me.TextBox1.Text & _
            "','" & Me.TextBox2.Text & "','" & Me.TextBox3.Text & "','" & Me.ComboBox.Text & _
            "','" & Me.TextBox4.Text & "'"")", conn)


Do anyone know what's going wrong around Me.TextBox4.Text. Thanks.

Question regarding result types in Sharepoint Enterprise Search

  

I'm trying to setup search scopes for content sources that are various shares on file servers in our domain, and the main things users will be searching for are autocad drawings and folders - searching by file/folder name. I've added the dwg file type to the list of file types included in the content index (we'll see if they show up in search results after the next incremental crawl), but I don't know how to add folders as a result type. Ideally, a user will be able to check off a box for Drawing/Folder/Word Doc/Spreadsheet/etc. right next to the text box where they enter the search term(s).

Any ideas?


Unclosed quotation mark after the character string ')

  

Hey!, I got a little problem in the web shop I am updating.

when a user wants to enter a item (say a city) like 's Hertogenbosch the page gives me the "unclosed quotation mark after character string" error.

Now i have been following multiple options  on the web, but since i am new to the whole asp.net and c# stuff i havent been able to get it to work.

Changing the whole thing to parameters is unfortunately not an option.

I hope anyone can help me with this.

 

Pierce

 

SqlCommand myCMD = new
 SqlCommand("insert into tmpCustomer (sessionid,firstname,namefix,surname,street,streetnumber,postalcode,city,nation,phonenumber,company,mail,payment,CustomerAlternateAddress,street2,streetnumber2,postalcode2,city2,CustomerOpmerking) values 
('"
+Session.SessionID+"','" +firstName.Value+"','" +nameFix.Value+"','" +surName.Value+"','" +street.Value+"','" +streetNumber.Value+

Question Mark appears to cause Unexpected Quantifier error

  

I have this piece of code:

        if (AllowedCharacters.search(SingleChar) != -1) {
            CharCount = CharCount + 1;
        }

AllowedCharacters contains a string (in this case it's ABCDEFGHIJKLMNOPQRSTUVWXYZ).

SingleChar contains a single character (any one of A B C a b c < > ? " and so on).

For the vast majority of the values of SingleChar, the code behaves exactly as I'd expect - if SingleChar is found in the string (so A B or C) then CharCount increases by one.  If SingleChar is not in the string (so a b c < > ") then CharCount does not get incremented.

BUT the ? is catching me out.  When SingleChar contains ?, the first line of code falls over with an "Unexpected Quantifier" error.

I'm guessing that the question mark is a "special case" in Javascript, but I can't find anything relevant.

Thoughts welcome.


Query with a question Mark reference in .NET

  

Ok... I know this is likely easy and it should be.  Foot in mouth 

I have a query in Microsoft Access 2003 or 07'.  Like the following:  Let's assume this query is named 'GetDudesStuff'

Here is the Raw SQL of the Query in Access: SELECT avail.MLS_CODE, avail.AV_DESCAD, CLASS.CL_DESC, CLASS.CL_DESCSUB, customer.CP_NAME, customer.CP_EMAIL, MFG.MF_NAME, avail.AV_DESCLN, avail.AV_UED, avail.AV_MACLASS, avail.AV_MATYPE
FROM ((avail LEFT JOIN MFG ON avail.AV_MFG = MFG.MF_CODE) INNER JOIN CLASS ON (avail.AV_MACLASS = CLASS.CL_CLASS) AND (avail.AV_MATYPE = CLASS.CL_TYPE)) INNER JOIN customer ON avail.AV_KOOPER = customer.CP_KOOPER
WHERE (((avail.MLS_CODE)=[?]))
ORDER BY avail.MLS_CODE;

In .NET how do I call this Query and add in the unnamed query?

I tried the AccessDataSource class, or just the OleDBDataSource/OleDBCommand with adding a parameter.  But it no worky...
(VB or C# me no care I can translate)


Please Indicate "Mark as Answer" if a Post has Answered the Question

  

 

While reading a reply to your question, you will notice a button with an icon that says "Mark as Answer."   Please select this button when a reply answers your question.

 

There are several reasons to do this:

  • Our search engine weights Answered questions more highly. By marking Answers you increase the chances that others searching this forum will find the answer directly rather than re-posting the question.
  • You give credit to the hard working folks who ans

Sharepoint 2010 Foundation search question

  

I'm new to Sharepoint and have just setup 2010 Foundation.  I know that it's search will only index the contents of Office docs and that you can't install ifilters in Foundation.  However, I would think that all documents uploaded to a doc library should be searchable by file name, is that correct?  However, using pdf's has an example, in my testing, search results come up empty when searching for keywords in the filename.  In order to make these files searchable, I have to edit their properties and add a Title.

I know that not all users will bother to manually add a Title to all documents, so we need to be able to find files by their names, how is this possible?

Rich


MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

  
If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend