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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

FillBy failing, SQL query works

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :Windows Application
I changed a query for a bound datagridview.  Original the datagridview showed all the columns, but I removed some of the columns by rightclicking on the datagridview.  I changed the fillby query to only include certain columns I selected.  Now it isn't working.  The same query works in MS-SQL, but it doesn't work in Preview data in the dataset designer. Can someone give me an idea of how to look for where my error is?

View Complete Post

More Related Resource Links

this my query works fine, i need to eliminate when resultset zero

hithis is the query working fineSELECT a.Selection,a.SizeRange,a.Thickness,       ISNULL(a.Assotment,0) - ISNULL(b.Issue,0)  AS difference1      FROM ( SELECT Selection,SizeRange,Thickness,                SUM(Pcs) AS Assotment            FROM  dbo.WBCAssortDescp where LotNo='LWC2'          group by Selection,SizeRange,Thickness) AS a LEFT OUTER   JOIN (SELECT Selections,SizeRange,Thickness,                SUM(Pieces) AS Issue            FROM dbo.WBIssue Where LotNo='LWC2'           group by Selections,SizeRange,Thickness) AS b on b.Selections=a.Selection and b.SizeRange=a.SizeRange and a.Thickness=b.ThicknessSELECT a.Se,a.Si.Th,      ISNULL(a.ent,0) - ISNULL(b.Ise,0)  AS difference1   FROM ( SELECT Se,Si,Th,               SUM(Pcs) AS ent           FROM  dbo.Table1where No='C2'         group by Se,Si,Th) AS aLEFT OUTER  JOIN (SELECT Ses,Si,Th,               SUM(Pieces) AS Ise         &nbs

Execute an SSIS package from ASP.net (C#) - my package keeps failing. Help! - Works on localhost but

I'm looking for any and all information on how to execute an SSIS package from my asp.net web site. I have written the call and when I run the application from (Localhost) it works, but when I run it from the server it does not.Here is my code to call and execute the package: public string ProcessFiles(int ClientID, string FileName) { //System.Security.Principal.WindowsImpersonationContext impersonationcontext; //impersonationcontext = ((System.Security.Principal.WindowsIdentity)ServiceContext.User.Identity).Impersonate(); string packagePath = "\\\\\\Customer File Import.dtsx"; Microsoft.SqlServer.Dts.Runtime.Application app; Microsoft.SqlServer.Dts.Runtime.Package pkg; Microsoft.SqlServer.Dts.Runtime.Variables vars; Application integrationServices = new Application(); DTSExecResult result; FileName = FileName.Substring(FileName.Length - 25 , 25); app = new Microsoft.SqlServer.Dts.Runtime.Application(); pkg = app.LoadPackage(packagePath, null); //pkg = integrationServices.LoadFromSqlServer("Customer File Import.dtsx", "", "healthtech\\brian.montfort", "Nightdragon8", null); vars = pkg.Variables; if (pkg.Variables.Contains("

SQL Query keeps failing on Where clause

I am very new to SQL so forgive me for this. We are upgrading to Dynamics AX 2009 and in doing so I have been volunteered as the report writer. Lucky me. I have a query that should return all items for a customer and their resective OnHand quantity in one field and in another field it should only return an OnHand quantity if certain conditions are met in another field, in this case a location field (example; product in Embargo). Also this Embargo could be a variation of locations, (example) louembarg, embargff, louembargun, etc. I have cleaned my query back up since I believe my path was way off track. Below the query is an example of what the end result should be. SELECT     TOP (100) PERCENT dbo.INVENTTABLE.DATAAREAID, dbo.INVENTTABLE.CUSTACCOUNT, dbo.INVENTTABLE.CUSTDIVISIONID,                       dbo.INVENTTABLE.PACKAGINGGROUPID, dbo.INVENTTABLE.ITEMGROUPID, dbo.INVENTTABLE.ITEMID, dbo.INVENTTABLE.NAMEALIAS,                       dbo.INVENTTABLE.ITEMNAME, dbo.INVENTTABLE.STANDARDPALLETQUANTITY, dbo.INVENTTABLE.BOMUNITID, dbo.INVENTDIM.WMSLOCATIONID,            &n

RenderAction failing in site.master, but works in a view

Hi, I have a master page into which I'm inserting a 'Search' partial view, which I've called 'pSearch.ascx'. I need to pass in a model to make some data available to pSearch, so I am using RenderAction from the site.master page, which then should call a [ClientActionOnly] Action on the 'Home' controller, called SearchPartial(), which in turn returns the pSearch view.Code from site.master:    <% Html.RenderAction("SearchPartial", "Home"); %>Code from HomeController.cs: (the method is virtual because I'm using T4MVC in the project)        [ChildActionOnly]        public virtual ActionResult SearchPartial()        {            return View(MVC.Curious.Views.pSearch);        }This is the error: "No route in the route table matches the supplied values."However, when I remove this line from site.master & insert the IDENTICAL RenderAction() call into one of my view pages, it works fine.I've been pulling my hair out, trying permutations of how it's called and different approaches, but can't work this one out, particularly because it works in a view page based on site.master, but not in site.master itself.Can anyone suggest why it wouldn't

MDX works fine in SSMS but not in query designer

Hi all,   I am trying to include this query in my query designer in SSRS. The query below is as follows:WITH MEMBER [Time].[Fiscal Month].[All].[ Subtotal] AS ' AGGREGATE( EXISTING { [Time].[Fiscal Month].[All].CHILDREN }) ', SOLVE_ORDER = 1000  SELECT NON EMPTY { { { { [Time].[Fiscal Month].[All].CHILDREN }, { [Time].[Fiscal Month].[All].[ Subtotal] } } * { { [Measures].[SKU Distinct Count] } } } } ON COLUMNS , NON EMPTY { [Sales Force].[Retailer Code].[All].CHILDREN } ON ROWS  FROM [Sales]CELL PROPERTIES VALUE, FORMATTED_VALUE, CELL_ORDINAL The error i am getting isThe query cannot be prepared: The query must have at least one axis. The first axis of the query should not have multiple hierarchies, nor should it reference any dimension other than the Measures dimension..Please let me know where am i going wrong.Thanks and regards,ram

Query crashes in MSAccess 2007 and 2010 on Windows 7 64bit, but works on 32 bit

Hello. I have a prepared a Database that contains 2 tables, and a Query. If you execte the query (Just a very simple join with a few where statments) Windows 7 crashes in 64 bit, but not on a 32 bit platform. Unfortunatly the Database has 300MB and is to big to be uploaded here. So if there is anyone interested at MS to get my Database, please feel free to contact me serge.dornseiffer@sdna.lu

Query acting weird.. larger date range works in 1min 26sec and a smaller range say 1 month - 3 month


I have no clue why my query is acting weird

If i try to run it for 1/1/2010 9/30/2010 the query takes around 1min 26 sec and  return around a million rows

and If i run for 8/1/2010 to 8/31/2010 it takes forever to it...

basically i am getting data from 5 tables and putting it in a temp table and then updating that temp table 2-3 times with some information and then displaying it.

I am stumped as to why it works fast for a longer date range and runs the  snail for a small period of time..

I am in the verge of pulling my hair and going crazy..

any help will be appreciated.




The mdx-query MMSM works - BIDS error


for me it's very strange, the following mdx-query

  exists([Date].[Month].[Month].ALLMEMBERS,[Current FY]) ON COLUMNS
  {[Company].[Company].[All]} ON COLUMNS
   {[City].[City].&[ADR]} ON COLUMNS
    {[Company].[Company].&[ASZ]} ON COLUMNS
   FROM [Cube]

the query works fine in SSMS and returns correct result but in SSRS BIDS returns error

TITLE: Microsoft Visual Studio

Query preparation failed.


The query cannot be prepared: The query must have at least one axis. The first axis of the query should not have multiple hierarchies, nor should it reference any dimension other than the Measures dimension..
Parameter name: mdx (MDXQueryGenerator)


first SSL request is failing for some clients, but the second SSL call works


I've got a WinForms client (using ASMX generated proxies) calling an SSL secured WCF service. Without SSL, everything works. With an SSL certificate on the server, some clients fail, but only the 1st web service request. If that same client sends the exact same request a 2nd time, it will work. This happens repeatedly for the same clients.

The client exception will be System.Net.WebException. Unable to connect to the remote server. System.Net.Sockets.SocketException: An invalid argument was supplied

My assumption is the SSL cert is setup incorrectly, but I'm not sure why it only fails for a few clients (although repeatedly), and why it will work the 2nd request? 

EDIT Also, if I turn on Fiddler to try and see the messages across the wire, then the exception does not happen.

Thanks, casey

SQL code works elsewhere, not in VS2010 Query Builder

SELECT caseid, recid, trandate, description, amount, SUM(amount) AS billtotal
FROM billtran GROUP BY caseid

The above SQL executes and gives me what I want under PHP/MySQL, but it won't even execute under VS2010 Express. When I put the above SQL code in the Dataset Designer Query Builder, I get an error: "In aggregate and grouping expressions, the SELECT clause can contain only aggregate and grouping expressions. [ Select clause = ,recid ]"

I don't understand what the problem is. What is the thing I must know about SQL that is different under Microsoft?

Crawl doesn't work and Query server is not responding; Search works only for old (crawled) contents


We have following three servers with MOSS 2007 STD deployed in SharePoint server farm,


App01- Query Server

App02 - Index Server (We are using this server as dedicated web front end computer for crawling)

SPDBServer - SQL 2005


Search was working fine till 01/05/2008 and it stopped working after this date only for new contents meaning search is still working fine for the old contents which were added before 01/05/2008 but not for new contents added after 01/05/2008.


We have been working to find out reasons why did that happen? We have found following event ids on Query server,


Event ID:10042 - A new query machine, 'App01', has been added to the query rotation based on changes to farm topology.

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.

How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

Content Query Web Part missing in SharePoint 2010

If you don't see content query web part listed in the web parts list, this is because you have not enabled "Search Server Web Parts" feature in site collection features. Enable this feature and content query web part will show in the list of web parts.

Code works on aspx but not ascx


Not sure which category to put this question in, so I will put it in here.

Just to give you an idea of the layout of my solution, I have the main project, along with 2 class libraries, BLL and DAL.  (Business Logic Layer and Data Access Layer)

The BLL refers to the DAL and the main project refers to the BLL.

I had a test website and the code worked fine, but the same code will not work on the real project. The only difference is that in the test project, the code was on an aspx code behind, whereas in the real project, it is an ascx code behind (Web User Control )

The code is:

Dim connectionString As String = ConfigurationManager.ConnectionStrings("ASPNETDBConnectionString").ConnectionString
        Dim recordEntry As New UserRecord(connectionString)
        recordEntry.UserName = "TestName"
        recordEntry.BMI = bMI
        recordEntry.BMR = bMR
        recordEntry.FTM = fTM
        recordEntry.TDEE = tDEE
        recordEntry.TodayDate = dateForToday

Dim connectionString As String = ConfigurationManager.ConnectionStrings("ASPNETDBConnectionString").ConnectionString

sql query that don't run



I'm going crazy... i've got a piece of code that don't update the database... Could somebody tel me why it doesn't run??

Dim conn As SqlConnection
        Dim cmd As SqlCommand
        Dim cmdstring As String = "Update Corsi Set [Contenuto]='" & TxtText.Content & "' Where [ID]='" & Request.QueryString("Id").Replace("'", "") & "'"
        conn = New SqlConnection(SqlAnni.ConnectionString)
        cmd = New SqlCommand(cmdstring, conn)

Need help with a linq to sql query


I want to display some stats in a listview contril.  The table contains a record for every impression and for every click, and every record has a datetime field for the time and date of the impression of click.  I want to be able to display how many impressions and clicks there were in a given day and hour, something like below:

Date              Time                              Impressions    Clicks
8/20/2010                                               450              14            
                     Midnight -1:00am               150               5

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