DataSource Controls :: Required Itz Urgent MS SQl Query?
May 19, 2010
I have two table Master table A, Master table B where i have Refno column...I need to check if Refno is avaialbale in Table C .. If itz available then i dont need to show Refno... If not available any oftwo master table then i need to show Refno with sum of (Quantity)
View 2 Replies
Similar Messages:
Aug 22, 2010
1. I have a GridView on my page and it uses sqldatasource with parameterized query. What I want to do is, on page load (where nothing has been selected so no parameter supplied), I want it to query everything (something like SELECT * FROM [this_table]) but since my SelectCommand is something like
SELECT * FROM [this_table] WHERE [this_column] = @someParameters AND [that_column] = @someParameters.
Can I play around with default value to achieve something like that but how ? Now, when the page loads, it doesn't show anything (No Gridview).
2. On my page, I made something like (username, gender, address, and more) and one single search button. That means, no single control enable auto postback. What I am trying to accomplish is building dynamic query
(if username specifed -> SELECT * FROM [this_table] WHERE [username] LIKE @username).
If both username and gender are specified (SELECT * FROM [this_table] WHERE [username] LIKE @username AND [gender] = @gender) and you know the rest. How can I do this using GridView and SqlDataSource ? To my knowledge, I can only specify one SELECT statement in a sqldatasource.
View 11 Replies
Jan 15, 2010
[code]...
This query works perfectly on the query analyser.
But when configuring the Table adapter ,I try executing the query and i get 0 rows affected.
What could I be getting wrong in this case.
NB:Existing GalleryID has been supplied.
View 1 Replies
May 17, 2010
By right clicking on my database i created a query in server explorer. But where are this query stored can't find them back. I should aspect that their is a folder query's like there is a folder tables but this isn't the case.
View 10 Replies
Mar 10, 2010
select Groupid,GroupName,onorusername from palgroup where groupid in (select distinct Groupid
View 5 Replies
Jan 21, 2010
I've got a query such as
Dim MediaQuery =
From m
In dB.DOWNLOADS _Where m.ID = id _Select
which returns a record from the database. One of the fields in the record is a FK to another table. I need to read this value to be able to set a dropdown based on the ID but I can't work out how to access it. For a standard record I can just do the following txtTitle.Text = MediaQuery.FirstOrDefault().TITLE
However with the foreign key it doesn't work like that. I've tried drpGroup.SelectedIndex = MediaQuery.FirstOrDefault().DOWNLOAD_GROUPS.ID where DOWNLOAD_GROUPS is the FK field but it returns Object reference not set to an instance of an object. If you're simply wanting to read some values from a single db record in the entitiy framework and one is a foreign key how should I go about getting the value?
View 2 Replies
Apr 13, 2010
I can't see what I've missed
Dim strSQL As String = _
"UPDATE [emailText] SET " & _
"[stdSubjectLine] = @subjLine, [stdBodyText] = @bodyText, " & _
[code]...
View 1 Replies
Jun 4, 2010
I am building a page that displays a product's details, with the information being called from an MSSQL database.I would like to be able to have a variable number of features listed for each product, so for example, Product A has a list of 3 features, Product B has a list of 7 features, Product C has 2 features listed etc.I would like to avoid having a lot of NULLS in my database, and would prefer not to restrict the number of possible features listed.Is there a common way to tackle this problem? Is it simply a case of setting up a table just to store features?
View 2 Replies
Sep 20, 2010
i am trying to create a datatable entering the columns that i create before, but i have a problem, the dataColumn doesn't have the required data, there is a AllowDbNull but it doesn't work.
Then i would like to add other restrctions like MinLegth.
Does anybody know how to do this?
View 2 Replies
Feb 2, 2010
I am writing an app that has a bit of process flow to it. On the save of a record, I need to check some fields to make sure they are not null. If they are not null, I will update a 'SectionComplete' field to true.
The thing is, I would like to store my fields in the web.config. So, I would like to have a string in the appsettings section that has a list of field names that are required. Then in my method, I would call these fields out and check each one for the specific record id, and then update the database.
I would like to do this in the web.config so we could add/remove columns without having to redeploy.
For example: my required fields are name, id, and phone. For section one to be labeled complete, all of these fields would need to be not null.
web.config would have this entry:
<add key="Stage1Fields" value="name, id, phone"/>
View 4 Replies
Aug 12, 2010
let us assume we have a Chemical master table with 10000 records. this table contains chemdesc,uom,closingquantity,closingvalue,...,createdon. for every chemical there are multilple records. so i want a query to get chemical name with recently created records. i mean to say that last record of each and every chemical. [if i have give date like 22-08-2010 then i should get records on or before latest record of each chemical]
View 3 Replies
Aug 24, 2010
I 'm gonna query database for photo records. each record include "photo path" where imagesURL stored in string format
I Choses my favorite Juqery plugin to show images. Plugin needs some lines of code like below.
How could I generate these lines
[Code]....
View 1 Replies
Apr 21, 2010
I am using Querystring "ddl4" to pass on value of a drop down list to the next page where I am using that value in the WHERE clause of a SQL command. I also need to check whether ddl4 is blank or not which I do using If Else in SQL command. I am not able to run the query where the Querystring ddl4 IS NULL
This is the sample link with the Querystring ddl4 carrying a blank value:
[code]....
View 2 Replies
Mar 5, 2010
how do i copy required row in dataset to a new dataset. i have bind a xml into a dataset and i need to display say row 3 to 5 only so i do a for loop but i have encounter problem when trying to copy the rows to a new dataset.
do i have to write the xml to datatable and bind it to dataset and from there copy over ?
View 7 Replies
Apr 2, 2010
I am using ASP.NET 2.0 and I need help for Crystal Report.I have four radio button in a web form as rdoStore1, rdoStore2, rdoStore3, rdoStoreAll.I have the data of three stores which I need to show in crystal report. User can select from the radio button either he want to see the data of a specific store or all three stores. The problem is that if user select rdoAll then I want to show the data of each report separately. I mean when the inventory of first store end then the inventory of 2nd and other store start. So the user can print all the report in one go and send the report to each concerned manager separately. Its mean here is total four report but print in one-go.
View 2 Replies
Apr 13, 2010
I have one query in my project (saved in folder SQLQueryes, Query.sql) and i need to execute it. Also, i have one parameter in script and i need to include him also. How?
View 8 Replies
Feb 18, 2010
SQL Query with IF and Select
View 2 Replies
Jun 10, 2010
if there is no relation bettwenn two tables why do i need union for example like below Please
can u inform me
SELECT categoryId
FROM categories
UNION
SELECT shipperId
FROM shippers
View 3 Replies
Jun 25, 2010
I´m using Linq to Sql in my asp.net application, but the problem is:I have a query like this:
[Code]....
My query is not returning anything, how do I do to get this?my problem is with this interval I need to have.
View 2 Replies
May 13, 2010
i want to know that should first name and last should be kept as sperate field or merged into single attribute. The Basic problem i am facing to keep first name and last name in seperate fields is that i cannot effectively use like query for searching a record by name
View 7 Replies
Mar 15, 2010
I have table in database with xml field and data like below
[Code]....
there are no records found
View 1 Replies
May 26, 2010
How do I use a Parentheses in an SQL query, example:
SET [myrow] = 'New Value' WHERE [myrow] = 'my (old) value'
View 2 Replies
Nov 24, 2010
I'm creating a web project in ASP.NET (C#) using Visual Studio 2010. I'm using the built-in login page. Here is what I'm trying to achieve.I want when a user logs in, the default.aspx page will display all his information including firstname, lastname, email address... I created a database table to store all users information (SQL). I want to use the "login name" as a parameter in "SELECT * FROM usertable WHERE username = loginname". From the code-behind (default.aspx.cs) I can pull the current loginname with "this.User.Identity.Name" but I can't pass this information to the query command in the default.aspx page.For example, when Jim logs in with his user name as "sirjim", I want to use"sirjim" in place of "loginname" in default.aspx page.Code in default.aspx page:
<asp:GridView
ID="GridView1"
runat="server"
[code]...
View 3 Replies
Feb 21, 2010
Hregarding to following query:
Use AdventureWorks
Go
ELECT p.ProductID,
piy.ProductID
What does mean ON 1 = 1 in this query??
View 3 Replies
Jan 4, 2010
I have 2 tables table1 and table2 as given below.
Table1 - user master table. table2 - transaction table. Now I want to write a single query which will give results like table 3. how to write single query.
TABLE 1
TABLE 2
TABLE 3
USER ID
[Code]....
View 13 Replies