You tried to assign the Null value to a variable that is not a Variant data type !



For small applications it is proper to use AccessDataSource object in order to access the database directly from asp.net page. When i first used it for inserting data with formview, it generated the following error :
"You tried to assign the Null value to a variable that is not a Variant data type"
today i tried the same thing again and it generated the same error again.
I found out that in the generated mark up, although id field is of type autonumber and primary key, visual studio generates a parameter for that field in the markup of the aspx page. I deleted those parameters from the insert command of AccessDataSource and FormViews Insert and Edit Item templates. Then


Related to : You tried to assign the Null value to a variable that is not a Variant data type !
Is it possible to assign a type to a variable?
ASP & ASP.net
I've done it through manually enumerating the types that I know of, but I'd like to make it more robust than that.
Code:
struct foo {
    ...
    int type;
    ...
};
struct foo bar;
bar.type = int;
That's what I'd LIKE to do. Is there a way?
Andy
You tried to assign the Null value to a variable that is not a Variant data type !
ASP & ASP.net

For small applications it is proper to use AccessDataSource object in order to access the database directly from asp.net page. When i first used it for inserting data with formview, it generated the following error :
"You tried to assign the Null value to a variable that is not a Variant data type"
today i tried the same thing again and it generated the same error again.
I found out that in the generated mark up, although id field is of type autonumber and primary key, visual studio generates a parameter for that field in the markup of the aspx page. I deleted those parameters from the insert command of AccessDataSource and FormViews Insert and Edit Item templates. Then

Is it possible to assign document type value in xslt variable?
ASP & ASP.net

I want to assign variable value on the condition, like below:

<xsl:variable name="publicationDoc" 
  select="document(@ID)/tcm:Component/tcm:Data
          /tcm:Content/em:PublicationData" />
<xsl:variable name="CountryCompId" 
  select="substring-after(
            $publicationDoc/em:Country/@xlink:href,
            '-')" />

<xsl:variable name="countryIdLocal">
  tcm:<xsl:value-of select="$publicationDoc/em:PubID" 
    />-<xsl:value-of 
    select="substring-after($publicationDoc
              /em:Country/@xlink:href,'-')" />
</xsl:variable>

<xsl:variable name="countryId">
  tcm:<xsl:value-of select="substring-before(
    substring-after($publication,'-'),'-')" 
  />-<xsl:value-of select="substring-after(
     $publicationDoc/em:Country/@xlink:href,'-')" />
</xsl:variable>

<xsl:variable name="countryLocal">
  <xsl:choose>
    <xsl:when test="$CountryCompId != '' ">
      <xsl:value-of select="document(
         $countryIdLocal)/tcm:Component/tcm:Data
         /tcm:Content/em:Country" />
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="''" />
    </xsl:otherwise>
  </xsl:choose>
  </xsl:choose>
</xsl:variable>

<xsl:variable name="country">
  <xsl:choose>
   <xsl:when test="$CountryCompId !='' ">
      <xsl:value-of select="document($
        countryId)
        /tcm:Component/tcm:Data/tcm:Content/em:Country" />
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="''" />
    </xsl:otherwise>
  </xsl:choose>
</xsl:variable>

//Above I am assigning value on the basis of condition , however it gives below error while I try to transform "To use a result tree fragment in a path expression, first convert it to a node-set using the msxsl:node-set() function"

Seems assigning document type values to variable doesn't work. ()

Any suggestions?


assign the final variable with the function return type
ASP & ASP.net

In java i tried to assign the final variable with the function return value. But i got the compilation errors. Can anyone help me what is causing the errors here?

the code is like this:

public class A{
  private static final set<String> set1 = getSet();
  private Static Set<String> getSet(){
     Vector<String> vector1 = getVector();//some function which
return the Vector of type String
     if(vector1!=null){
           set1=new HashSet<String>(vactor1);
     }
     else{
           set1= new HashSet<String>();
     }
  }
}

SQL Database Column with Variant Data Type
ASP & ASP.net

I am writing an application in which users are able to add "inputs" to a form. These inputs could be of multiple different types including a textbox or checkbox.

In the case of a textbox versus a checkbox, the data types are string versus boolean.

More Information About My Application

1) A user is able to create a "form" that may have multiple different types of inputs for a customer to fill out. Here are some examples. These inputs can be dynamic and are created by the user.

  • An input that may ask for a users name.
  • An input that consists of a checkbox asking if a user wants to be enrolled in a newsletter.

2) The user saves the form, and in the database, based on the type, the newly created input is saved.

3) A new user comes into the application and fills out the new form that was just created. They fill out the inputs that the original admin created such as their name and they answer yes to enrolling in the newsletter. Then they click submit.

4) The database then saves the answers to inputs. This is where my problem lies.

My question is how do you store the inputs value in a row in SQL. I have a couple solutions that I will provide but am looking for a consensus on what is typically done in this situation.

  1. Solution #1

Input Name

Input Boolean Value - (would be NULL when not a boolean type of input)

Input String Value - (would be NULL when not a string type of input)

  1. Solution #2

Input Name

Input Type

Input Value (of type string, and i would cast it based on the type)

  1. Solution #3

Input Name

Input Type

Input Value Key - (weak foreign key to a table depending on the Input Type. This would not be a real foreign key because it could point to multiple different tables)


Append variant type variable
ASP & ASP.net

Files is a global variable which stores file paths. chosen by the user. Files is stored as a named range. in the subprocess " test" as Filesvar

Public Files As Variant

 Sub Consolidate() ' performs  consolidation
    Application.EnableEvents = False
    Application.ScreenUpdating = False
    On Error GoTo errhandle
    Application.DisplayAlerts = False
    Files = Application.GetOpenFilename("Excel Files (*.xl*), *.xl*", 
     Title:="Select files to Consolidate", MultiSelect:=True)

 Call Test
    For Z = LBound(Files) To UBound(Files)
    Tem = Split(Files(Z), "")
    If (Tem(UBound(Tem)) <> ThisWorkbook.Name) Then
    ..... ' consolidation

   end sub

 Sub Test()
      ActiveWorkbook.Names("Filesvar").RefersTo = Files
 End Sub

The following code counts cells with color index 23 and copies the value of cell with color index 23 into the source sheet. (the color index 23 is a change event whenever a cell is modified)

    Sub Sync(s As Variant, pkey As Variant, NRemark As
String)
        Application.EnableEvents = False
        s.Sheets("Issues").Select
        Cells.Range("A1").Select

        On Error GoTo check

        Cells.Range("A:A").Find(What:=pkey, After:=ActiveCell,
LookIn:=xlFormulas, LookAt:= _
        xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=True _
        , SearchFormat:=False).Activate
        ActiveCell.Offset(0, 22).Select



v1:     Tstamp = Now
        ActiveCell.Value = Tstamp & vbNewLine & NRemark &
vbNewLine & ActiveCell.Value & vbNewLine
        ActiveCell.Font.ColorIndex = 25
        Call comment_update
        Call copy_list
        Call paste_list(s)
        ActiveWorkbook.Save
        Application.StatusBar = False

check:


        ActiveWorkbook.Save
        ActiveWorkbook.Close


        Application.EnableEvents = True
    End Sub


Sub select_color() ' selects colored cells and stores value to copy to
source sheet 
    Dim NRemark As String
    Dim s As Variant
    Dim pkey As Variant
    Range("C3").End(xlDown).Select
    LastRow = ActiveCell.Row
    Range("X3").Select
    Do While ActiveCell.Row <> LastRow + 1
        If ActiveCell.Font.ColorIndex = 23 Then
            ActiveCell.Font.Color = vbBlack
            NRemark = ActiveCell.Value
             If NRemark = "" Then
             GoTo 1
             End If
            Call comment_update
            ActiveCell.Offset(0, -22).Select
            pkey = ActiveCell.Value
            Files =
Evaluate(ActiveWorkbook.Names("Filesvar").RefersTo) ' loads saved user
input path
            For Z = LBound(Files) To UBound(Files)
                Tem = Split(Files(Z), "")
                If (Tem(UBound(Tem)) <> ThisWorkbook.Name) Then
                    Application.ScreenUpdating = False
                    Application.AskToUpdateLinks = False
                    Application.DisplayAlerts = False
                    If IsFileOpen(Files(Z)) Then
                        Set s = Workbooks.Open(Files(Z))
                        Call Syncopen(s, pkey, NRemark)
                    Else
                        Set s = Workbooks.Open(Files(Z))
                        Call SyncClosed(s, pkey, NRemark)
                    End If
                End If
            Next
            ActiveCell.Offset(0, 22).Select
'            Range("X:X").ClearComments
'            Call ReviewerRemarks
             Call Comments_AutoSize
'Call Protect
            Application.StatusBar = False
            Exit Sub
    errhandle:
            ActiveCell.Select
'Call Protect
            Application.StatusBar = False
            Application.EditDirectlyInCell = True
            End
Save_Error:
'            MsgBox "Sorry, " & Tem(UBound(Tem)) & " is in use
, Unable to save your Remarks "
myerror:

            Exit Sub
        Else
1:
            ActiveCell.Offset(1, 0).Select
        End If
    Loop
'End If

End Sub

    Function CountCcolor(range_data As Range) As Long ' count cells
with              color index 23
    Dim datax As Range
    Dim xcolor As Variant
    xcolor = 23
    For Each datax In range_data
    If datax.Font.ColorIndex = 23 Then
        CountCcolor = CountCcolor + 1
    End If
    Next datax
    End Function

    Sub ColorRange(), copies changed cell value to source sheet
    Application.ScreenUpdating = False
    On Error GoTo 1
    Application.StatusBar = "Syncing ..."
    Dim x As Integer
    Range("B65535").Select
    Selection.End(xlUp).Select
    LastRow = ActiveCell.Row
    Selection.End(xlUp).Select
    StarttRow = ActiveCell.Row
    x = CountCcolor(Range("X" & StarttRow + 1 & ":X" &
LastRow))
    For i = 1 To x
        Call select_color
        Next i
    If x <> 0 Then
'   MsgBox x & " Reviewer remark(s) have been updated
Successfully"
    Application.StatusBar = False
    Else
    GoTo 1
    End If
    1:
    End Sub

The issue with this code is that if the user consolidates another file with the existing consolidation . then the value of "Files" changes to the path of the newly consolidated file. Is there a way to save to the older value of "Files" and append it with the new path .

if the user selects different paths every time he consolidates then the sync() function must copy the corresponding cell value to the correct paths of the source file .



HD Wallpapers
3D
3D Abstract
City
Celebrities
Indian Celebrities
Cars
Travel
Girls
Animals Birds
Movies
Sports
Black White
Nature
Planes
Anime
Food Drink
Dreamy Fantasy
Architecture
Games
Space
Holidays
Flowers
Love
Artistic
Baby
Beach
Bikes Motorcycles
Macro
Computers
Vector
Funny
Army
Textures
Brands
Misc
Music
Other
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .