Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Ask about LINQAsk about LINQ
Previous
 
Next
New Post
6/27/2008 12:52 PM
 

i had face a problem "Operator '==' incompatible with operand types 'Int32' and 'Object'" which

i follow the tutorial of http://www.adefwebserver.com/DotNetNukeHELP/LinqTutorial/

im using VB.NET

 

Thx for help !

 
New Post
6/27/2008 1:02 PM
 

Hi Jackhui,

it looks like you are trying to evaluate if an Object is equal to an Integer number. This causes the compiler to raise the error. Could you post the code you are using?

Best regards,
Dario Rossa

 
New Post
6/27/2008 1:27 PM
 

"==" is a C# construct ... . if you're using VB, try a single equal sign...   "="

 
New Post
6/28/2008 10:34 AM
 

Sorry i dint say clearly, this error is occur only when i write in ascx page:

 <asp:LinqDataSource ID="LinqDataSource1" runat="server"
    ContextTypeName="Testing2.Testing2DataContext" EnableDelete="True"
    EnableInsert="True" EnableUpdate="True" TableName="TestingTable2s"
   Where="ModuleId == @ModuleId"   >
    <WhereParameters>
        <asp:Parameter Name="ModuleId" Type="Int32" />
    </WhereParameters>
</asp:LinqDataSource>

 

 

 

Another question, can enyone help me convert  it into VB code ?

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if ((e.Row.RowType == DataControlRowType.DataRow))
{
ThingsForSale ThingsForSale = ((ThingsForSale)(e.Row.DataItem));

if ((PortalSecurity.IsInRole("Administrators"))
|| (Entities.Users.UserController.GetCurrentUserInfo().UserID == (int)ThingsForSale.UserID))
{
e.Row.Cells[0].Enabled = true;
}
else
{
e.Row.Cells[0].Text = " ";
}
}
}

 
New Post
6/28/2008 11:03 AM
 

I used to the C# to VB conversion tool from DeveloperFusion. There may still be a couple of errors but you should be able to fix them up.

  1. Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
  2.     If (e.Row.RowType = DataControlRowType.DataRow) Then
  3.         Dim ThingsForSale As ThingsForSale = DirectCast((e.Row.DataItem), ThingsForSale)
  4.        
  5.         If (PortalSecurity.IsInRole("Administrators")) OrElse (Entities.Users.UserController.GetCurrentUserInfo().UserID = CInt(ThingsForSale.UserID)) Then
  6.             e.Row.Cells(0).Enabled = True
  7.         Else
  8.             e.Row.Cells(0).Text = " "
  9.         End If
  10.     End If
  11. End Sub
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Ask about LINQAsk about LINQ


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out