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


Top 5 Contributors of the Month
david stephan
Post New Web Links

Remove member wiht contains null value

Posted By:      Posted Date: October 16, 2010    Points: 0   Category :Sql Server
 

HI all 

 

i have data like this

Feb March April May

Bike 20 10 20 30

shoes 10 Null 10 20

Jacket 50 100 Null 50

 

i want to remove product containt null values in any period

if range time from Feb until may, data show

 

Feb March April May

Bike 20 10 20 30

 

 

if range time Feb until March, data shoe

 

Feb


View Complete Post


More Related Resource Links

Need to display Blank Member as a NULL in one of the column Level

  


 Hi ,

  1. select NON EMPTY {[Measures].[Balance], [Measures].[Peso Equiv]} ON COLUMNS,
     NON EMPTY Hierarchize(Union(Union(Union({[PARTICULARS].[All Particulars], [PARTICULARS].[All Particulars].[RESIDENTS], [PARTICULARS].[All Particulars].[NON-RESIDENTS], [PARTICULARS].[All Particulars].[NON-RESIDENTS].[NON RESIDENT OTHERS], [PARTICULARS].[All Particulars].[NON-RESIDENTS].[NR OTHER BANKS], [PARTICULARS].[All Particulars].[NON-RESIDENTS].[NR CORPORATIONS]}, [PARTICULARS].[All Particulars].[NON-RESIDENTS].[NON RESIDENT OTHERS].Children), [PARTICULARS].[All Particulars].[RESIDENTS].Children), [PARTICULARS].[All Particulars].[RESIDENTS].[GOVERNMENT].Children)) ON ROWS
    from [depositlib_22]
    where [REPORT DATE].[All Report Date]
    
    
    ----------------------------------
    
    |                                                   | Balance     | Peso Equiv     |
    +-----------------+---------------+-----------------------------------+-------------------------------+------------------+--------------------+
    | All Particulars |        |                  |                | 8,286,706,398.76 | 373,066,873,125.05 |
    |         | RESIDENTS   |                  |                | 8,279,166,150.24 | 373,059,101,772.19 |
    |         |        | GOVERNMENT            |                |      68.38 |       68.38 |
    |         |        |                  | NATIONAL

The null value cannot be assigned to a member with type System.Int32 which is a non-nullable value t

  

Hi All,

        int maxAge = db.tbl_zaposlenis.Where(p => p.IdSifra == 22)
                         .Max(p => p.IdSifra);

        zaposleni.IdSifra = maxAge;

How to display the largest number in the "IdSifra?


thanks.


How to avoid null pointer exception when you use invoke member in c#?

  
Hi ,

I am working on one of the projects where I have to use the Reflection. I have a file which has values of datatype double,string, date and time as well as empty data (null). When I import the data using invoke method, it returns the null value as one of the data in the file is empty and throws "null reference exception".
try{
value =object.GetType().InvokeMember(string, BindingFlags.GetProperty, null, object, null);
}
catch {
        if (value == null) {                    
           value = null;
                }
}
I catch the exception and forcefully make it null than crashing my project. When I do this, the performance of the import is very slow. The data fetch is very slow as it goes like 419  times into the catch. How to avoid this the slowness of the fetch.?  try and catch will take a lot of time in fetch as I am  catching the exception and making it null. But if I do not catch it then it will crash in the middle. I need some input on this issue. Please help me out with this.... The data fetch is perfect but it has become slow due to the try and catch..  

SSAS 2008 - Date Member Property gets converted from NULL to (Blank)

  

Hello everyone,

I have this cube with a dimension of investment deals.  The "Deal" member has a attribute named "Latest Acquisition Date" where this date can be null for some deals.  Once the cube is processed, the null dates always get converted to "(blank)" either in BIDS cube browser or in Excel.  This happens no matter what I do to the NullProcessing property of this date attribute.

Is there any way to have SSAS display [NULL] (as in nothing at all) instead of "(blank)" ?


Model with List as member: Member alwasys NULL after submit

  

Hello,

I have following model class:

public class WebModel
{
    public List<ArticleModel> Articles { get; set; }
}

public class ArticleModel
{
    public int ID { get; set; }       

    public double ValueParam { get; set; }
}



Then I have the controller with the two actions:

[Authorize]
public ActionResult Index()
{
      WebModel model = new WebModel();
      ModelConverter.ConvertToModel(model, controller);    
      return View(model);
}

[Authorize]
[HttpPost]
[ValidateInput(false)]
public ActionResult Index(WebModel model, string saveButton)
{
      ModelValidation.ValidateWebModel(model, ModelState);
      if (ModelState.IsValid)
      {
                return RedirectToAction("Create", "Article");
      }           
      ModelConverter.C

Remove #Region from whole web site

  

Hi All,

I need to deliver source code to client and my boss need to remove all the comments and #region sections from the whole web site source code.

So is there any functionality available in visual studio 2010 or may be in an other 3rd party tool available to do so, which can remove all the #region from all over the source code ?

Otherwise my developers has to do donkey work.... :(( and I don't wish it. 

Any help or tips/tricks would be appreciated.

Thanks


How to check for null/empty strings on dynamic objects?

  

What is the proper way to check for null or empty strings on dynamic objects? This is the only solution I've found so far:

if (admin.PasswordHash.GetType() == typeof(DBNull) || admin.PasswordHash == string.Empty)

If the field is null, the object returned is DBNull.Value, but if the field is empty string, it's return as a System.String object. This makes it impossible to do regular "admin.PasswordHash == DBNull.Value" check, as that will fail whenever the field has been set to empty string. Is my example the right (and only) way to go?


Users getting logged out because HttpContext.Current is null

  

We've  been trying to fix this one for a couple years, and I'm just out of ideas, so any help is really appreciated!

We've got a fairly large, complex web application that uses Forms Authentication to authenticate users.  Throughout the application we store and retrieve information about users in the Session object, and in some cases in cookies.  In a couple places we check for the existence of the context, and if it's null we send the user back to the login page to re-establish the session. 

Just a quick run-down of this web app: C#, .NET 3.5, IIS 6, ASP.NET State Service to manage session

As for the session timer, we use our own home-grown timer, which is basically a client-side timer, which is backed up by a check to the SQL database to see when their last activity was.  This seems to work well for us.  It's not perfect, but it allows us to notify the user before the session times out, and allows us to be certain we're not logging a user out before their 60 minutes of inactivity is up.

What's happening is that certain users are being logged out after just a few minutes.  We've eliminated the timer as a cause and believe what's happening is the HttpContext.Current is null, so the user is logged out.  We do not know why the HttpContext.Current is null, and I underst

Get Member from LDAP using C# 2.0

  

I'm currently writing a process where I need to determine if an User on my LDAP string is an Admin.

How can I accomplish this?  What would be the easy and quickest way?

I've been trying to use the code below..... Any feedback is greately appreciated. Tks

 

 


Web deployment project - web.config section replacement does not add remove tag

  

I have a web application that is actually installed as a component of a third party site.  In some configurations, I need to remove certain connection strings and re-add them.  I'm replacing this web.config section with a xml file that includes the following:

<connectionStrings>
      <remove name="MyOverridenConnection"/>
      <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection"
           providerName="System.Data.SqlClient"/>
    </connectionStrings>

For some reason the remove tag is left out during the substitution and I end up with the following in the installed config:

<connectionStrings>
      <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection"
           providerName="System.Data.SqlClient"/>
    </connectionStrings>

Is there any way to issue removes in replaced sec

Remove characters in a string

  

i have a string like this   sravani/, asdfff/, lsdsf/
i want to remove last character '/'  in the above string...
which function can i use?


pls help me....


'element.className' is null or not an object

  

 Hi,

I just downloaded the project, compiled it and ran it right out of the box and when I put the mouse pointer over or remove the mouse pointer from either MenuItem in the menu demo, I generate this error:

'element.className' is null or not an object

It points to this javascript method:

updateClassName: function(operation, element, name, value) {
        this[operation + 'String'](
                function() {
                    return element.className;
                },
                function(newValue) {
                    element.className = newValue;
                },
                value
          &nbs

Page.FindControl Causing Null Reference Exception

  

Hi guys,

I developed a page in VWD 2008 and it works perfectly locally, but when I deployed it on the server every Page.FindControl() call is causing the NullReference Exception "Object reference not set to an instance of an object. " Can anyone help me out? Code is below

Cheers,

Mike Marshall

            For i As Integer = 1 To 10
                If (CType(Page.FindControl("last_" & i), TextBox).Text.Length > 0) Or (CType(Page.FindControl("first_" & i), TextBox).Text.Length > 0) Or (CType(Page.FindControl("dob_" & i), TextBox).Text.Length > 0) Then
                    Dim person_entry(7) As String
                    person_entry(0) = info_list.Count - 1
                    person_entry(1) = CType(Page.FindControl("last_" & i), TextBox).Text
                    person_entry(2) = CType(Page.FindControl("first_" & i), TextBox).Text
                    person_entry(3) = CType(Page.FindControl("dob_" & i), TextBox).Text
                    person_entry(4) = CType(Page.FindControl("appear_" & i), TextBox).Text
                    person_entry(5) = CType(Page.FindControl("mental_" & i), TextBox).Text
                    person_entry(6) = CType(Page.FindControl("behave_" & i), TextB

linq and max, if return null return error

  

hi there
i have this query :

var result2 = (from TH in DB.Threshold
                          where TH.ProductSKUID == int.Parse(HID_ProductSKUID.Value)
                          select TH.ThresholdID).Max();


the problem is that if this query does not find any items, return null, so thow exception
how can i do to return 0??


ObjectDataSource CancelSelectOnNullParameter="false" // Select all when select parameter is null or

  

Hi ! I am using an objectdatasource in my project and I want to select all rows when the selectparameter value is empty ! I did the following but I am failling;
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="TugberkUgurluCom_TransferModule.TransferPriceDetailsAll" SelectMethod="GetAllDataFromPricesForControl" TypeName="TugberkUgurluCom_TransferModule.TransferPriceDBComponent" UpdateMethod="UpdateTransferPrices">
<SelectParameters>
    <asp:ControlParameter ConvertEmptyStringToNull="true" ControlID="DropDownList1" Name="TpDestID" PropertyName="SelectedValue" Type="
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