Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AspDotNetStoreFront
  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
CrystalTech Web Hosting™
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! (Pro...  Ask about LINQ
Previous Previous
 
Next Next
New Post 6/27/2008 10:52 AM
Resolved
User is offline Jackhui
17 posts
10th Ranked


Ask about LINQ 

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 11:02 AM
User is offline Dario Rossa
366 posts
www.dariorossa.it
8th Ranked




Re: Ask about LINQ 

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


Dario RossaDario Rossa
Personal WebSite: http://www.dariorossa.it
DotNetNuke: http://dotnetnuke.dariorossa.it
 
New Post 6/27/2008 11:27 AM
User is offline Steve Fabian
1516 posts
5th Ranked








Re: Ask about LINQ 

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


Steve Fabian
Gooddogs.com
Sit, Stay, Code ... Good boy!
 
New Post 6/28/2008 8:34 AM
User is offline Jackhui
17 posts
10th Ranked


Re: Ask about LINQ 

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 9:03 AM
User is offline Mike Horton
3185 posts
dnn.gmss.org
4th Ranked






Re: Ask about LINQ 

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 Previous
 
Next Next
  Forum  General DotNetN...  Extend It! (Pro...  Ask about LINQ
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Personify Design, Inc.
Seattle-based Personify Design has developed customized DotNetNuke websites for a wide range of customers to meet many different types of needs, including distributed authorship across thousands of pages to integrated Verisign e-commerce capabilities.
www.personifydesign.com
DNN Outsourcing
50% more affordable services comparing to Western Europe and US: Custom DotNetNuke module development, skins, consulting, maintainence... Over 15.000 working hours of experience in custom DotNetNuke Solutions development, 8 years experience in outsourcing, excellent references!
www.dnnoutsourcing.com
Expressnet - DotNetNuke Hosting
Expressnet provide premium quality ASP.NET Web Hosting. We specialise in Windows based products including ASP.NET and Microsoft SQL Server. We offer fantastic value packages for DotNetNuke hosting. We also offer free asp.net web hosting
www.expressnet.com.au

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP