Anyone know how to write a select statement to where it returns results that have a specific character count? I want to return all results that have 5 characters.
I have a basic CMS which I'm adding to a site to display some downloads organised into groups. I have two tables, one for the groups and one for the downloads. I'm using a repeated to display the groups with another repeater inside to display the children. This works perfectly.
However some of my download groups may not have any downloads related to them and I'd like to handle this by filter the groups so that only those with a relate download record(s) are shown.
I'm trying to do this with the query which populates the top repeater based on some ideas I read but I must be going wrong with the syntax.
Here is what I'm using to try and only select downloads groups which have downloads linked to them by the download group ID.
[Code]....
Can anyone offer any thoughts on how I should construct the query to perform this?
the best way to achieve the following:A products table linked to an images table where 1 product can have many images.Simple scenario is to select a product and its images using
select * from products where id=5 select * from images where pid =5
So far so good, its easily mapped to an object once the query has executed with ado.net.
what if i want to select all products and their related images and map them to a Product object, the result is as follows
I have an employee salary table with fields empId, month, year, salary. I need query for the following - Total salary drown each employee last year - Id of the employee who got highest salary last year. i am getting wrong o/p for these queries.
The drop down list is used to determine what search criteria will be used to find an invoice. I tried to set the Select method in the switch statement. I don't understand how to set the Select Method and the select parameters programmatically though . I tried a few different ways but can't make the compiler happy. My ODS is in scope in the code behind. I'm not able to access it's properties though. The BAL resides in a separate project that is a ClassLibrary. I also have a using statement for the ClassLibrary project in the code behind.
I will declarate a attribute, but it gives me an error
This query works fine and returns 1 record from type int:
SELECT TOP 1 DataObjectVersionID FROM tblDataObjectVersionPropertyValueText WHERE PropValue like CAST('00010281' AS ntext) ORDER BY DataObjectVersionID DESC
And when I will declarate a attribute/parameter it gives me an error:
DECLARE @dataObjectVersionId INT SET @dataObjectVersionId = SELECT TOP 1 DataObjectVersionID FROM tblDataObjectVersionPropertyValueText WHERE PropValue like CAST('00010281' AS ntext) ORDER BY DataObjectVersionID DESC
Error message:
Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'SELECT'.
I'm trying to do: I have a webform with a datalist. The datalist shows projects (projectname, image and an imagebutton). When a visitor clicks the imagebutton two events should take place:
- First: data should be send to SQLdatabase (projectID, name of project, sessionID, datetime etc).
- Second: a pop up window must be opened to an existing webpage of the facilitator of the project, using an url which (is in my database).
The problem is my two seperate pieces of code-behind work fine, it's just that they won't work together. Here is my code: The imagebutton:
I am trying to get the highest, lowest and average values from displayed gridview and then highlight the numbers. I had this code working, but now, I don't know what's going on. It does NOT give me the correct values!!! What's wrong? For simplicity I just give the code of getting the highest number. Here is my code:
I am working with a client on a web site that I am required to create a main page and from that main page a user will click on a div pops up and iframe. Inside that Iframe I have six pages. From with in the iframe I am able to navigate the pages. One of the pages is a place for the user to upload photos and I am using the standard asp file upload control and using a datalist to store the photo on this page. When the file is uploaded it will save to the url to the database and place the image in a folder.
Now the hard part once the image is save it has to appear on the main page in the photo div without refreshing the page. I have spent several hours searching the internet with no results.
I have a table that needs sorting by its hierarchial structure of parent-child.
An example of my table is below
ID Name Parent ID Sort Order 1 iPhone Dev 0 1 2 iPhone Lounge 0 2 3 Web Development 0 3 17 Javascript 3 1 24 CSS 3 2 25 prototypes 17 1
As you can see above, my table structure follows this pattern
[Code]....
My overall aim is to have the sql order the table for me, and by using this new "depth" column, I will be able to indent by categories in the menu on the front end, you have probably seen this before, but all the tutorials I have read dont really explain it very well, or assume you are sql savvy.
I am unsure on how to perform this task, what i need to do is make a gallery with tagging. I need this as it is a requirement for the project. Each user will have there own gallery and be able to upload and delete images from there gallery. I already know how to insert and select images from a database. I will then display the gallery using a data repeator with paging, I am sure i can google an article for data repeator with paging.
My challenge is, when the user wants to save a image to there gallery, he must 1st upload the image and then i must some how display the image, when the image is displayed, i will have a text box where they can add tags, this textbox will save in the tag table for that user_id, picture_id and the tag will have an id also. I am unsure on how to do this When he clicks save, i wanna insert the image into the table, and the tag. If he does not click save, then nothing should be saved. Now the 2nd part.
In the data repeator, i want a modal window to popup when they click an image, this modal will have the image and the respective tags that where saved for this image, I am unsure how to this.
I know how to handle the filtering of the grid (create a criteria and set to rowfilter of the dataview) But, I dont know how to get the value of the column of the selected row.
I have a table that have LibraryID and LibraryParentID.
LibraryID int Unchecked Name varchar(50) Checked Description varchar(200) Checked LibraryLevel int Checked LibraryParentID int Checked LibraryTypeID int Unchecked
I want to write a sql to delete the currrent select parent and well as all child record, how can I do that?
I am just getting started with entity framework with asp.net 3.5 using VS 2008
There are two tables, Categories & Subcategories:
Category table: CID, CategoryName Sub Category table: SID, CID, SubCategoryName I would like to get SID, CID, CategoryName, SubCategoryName in the gridview. Just as we write a select statement i.eSelect a.sid, b.cid, b.categoryname, b.subcategoryname from subcategories a inner join categories b on a.cid=b.cid & put the same in a gridview.
I was trying for the whole day & couldnt get atleast one url that would teach how to do it.
Is there a way to create a contact form that takes the name. address and other info for the master record; Then, somehow, on the same page, allow the user to enter multiple contact info as chid records (i.e. phone, email, etc.)
All this using the Objec DataSource or SQL DataSource (which ever is easy) and doesn't require writing too much code.
I would like to outsource pieces of a new web application/site. I don't want one company working on the whole project because they can easily change a few things and sell the software to someone else. I will be using a freelenace website like elance or guru. A buddy of mine has given me this advice but he did not say how this can be done.
Is it possible to add a property to the existing asp:BoundField control without creating a brand new instance to which I'd have to declare <tst:BoundField></tst:BoundField>? If so, can someone provide an example?
I am trying to comprehend what I need to accomplish but I'm even struggling with the logistics of a this task. Okay, so I am pulling in a field from a SQL table. An example string value would be "Text: 150". The string for this field will always start with "Text:". I need to take the value, strip the "Text:" off the value, then compare the number at the end to carry out further error checking. Hopefully that makes some sense. I've never tried to do anything like this so I don't even know if it is possible.
I have two tables dept and employees those table have parent and child relation ship link column is deptno i want to delte department even this departmetn contains employees i want to write storedprocedure for first delte employees and after department if i wrtie these two querys in storedprocedure will i get any problems
Begin Delete from tbl_employees where Department_Id=@Department_Id Delete from tbl_Department where Department_Id=@Department_Id RETURN END