.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

syntax error in calling mailhelper class??

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net

I use to program with VB.NEt. I am just learning C#.  I need to learn C# b/c I am a SharePoint developer and Admin and thats what SharePoint is coded from.


so I am trying to create a simple form that sends an email but am getting an error with calling this function:

       mailHelper.SendMailMessage("admin@pointeightpower.com", "jstevens@pointeightpower.com", null, null, "August Heat Stress", String.Concat(txtSupervisorName.Text.Trim, "reviewed this month's training on ", System.DateTime.Now));


it says param string has some invalid arguements. I dont know why. it works in VB.Net. any help? Thanks

View Complete Post

More Related Resource Links

Syntax error (missing operator) in query expression

Good Day Gurus!

I have a Excel user application which has a user form (named 'Registo') that displays criteria and an image that has been entered in it's corresponding spreadsheet. This works the way it should.  There's also the ability to search the spreadsheet via a form (by clicking 'Pesquisar' button) this opens a search form. However, I having a bit of a problem with it. When I try to search for something it basically doesn't do anything at all. It just sits there. So I tried to debug it and I think I'm having a problem with either the JET db engine or somethign with teh query or maybe I don't have the correct reference.

I 'borrowed' this Excel application from another forum because it's exactly what I'm looking for! However, I suck at vb.

So I was hoping somebody could take a look at the code and see if I'm missing something?  I'm kinda' desparate to get this working because I'm been trying to figure it out for days and I'm running out of time.  Cry
Option Explicit

'constantes para auxiliar na verificação do código
Private Const Ascendente As Byte = 0

Incorrect syntax near 'GO' error while running a sql script ?


I am using Visual Studio 2008

I have one Database A

now i want to create Database B just like Database A

I generated a script of Database A

and created fresh Database B

Now, when i try to run the generated script against Database B, i get this error, why ? how to fix it ?

sql error

For your information:

I have checked in my script it is:


and i have also tried to save the sql script in notepad as: ANSI, UTF-8 and UNICODE

and then i copied from txt file to query but still doesn't work and getting the same error

and these are the option that i selected/used while creating my script:


override of base class error please help!!!


i would really like to override http keepalives for my webservice and i found some source code that seems promising but i get an error that says

"function GetWebRequest" Cannot be declared override. 


    Protected Overrides Function GetWebRequest(ByVal uri As Uri) As WebRequest
        Dim webRequest = DirectCast(MyBase.GetWebRequest(uri), HttpWebRequest)
        webRequest.KeepAlive = False
        Return webRequest
    End Function

how do i implement this into my serivice and why im i getting this error??? in other words what in hell is the uri that i should be passing into this function.

Any assictance would be greatly appreciated.


LINQ to SQL compiler error CS1519: Invalid token 'void' in class, struct, or interface member decl

I get the following compiler errors when creating my first LINQ to SQL class (I just dragged a table "ProfileExtended" onto the designer and hit build):DataClasses.designer.cs(31,11): error CS1519: Invalid token 'void' in class, struct, or interface member declaration these are the offending lines of autogenerated code:#region Extensibility Method Definitions  partial void OnCreated();  partial void InsertProfileExtended(ProfileExtended instance);  partial void UpdateProfileExtended(ProfileExtended instance);  partial void DeleteProfileExtended(ProfileExtended instance);  #endregion

Error calling WCF service that is returning list.".Debugging resource strings are unavailable ......

Ok.this is just making me frustrated... Here is step by step of what I am trying to do (& not able to) 1. I am calling WCF service hosted in a SharePoint 2010 site from a silverlight app in same domain (So no cross doman I guess). 2. I use Linq to Sharepoint for querying the DB. 3. I am having a list "machines" in Sharepoint 2010 that is having a lookup column from Other list called "part" 4. My WCF method GetAllMachines() works perfectly well when it skips the lookup column "partname" & returns List of type machineitem. 5. But problem occurs when I add machineitemobject.parts.partsname in my Linq to Sharepoint query . My service gives the error not found Async_ExceptionOccurred] Arguments: Debugging resource strings are unavailable." 6. Note that return type of my Method is List<machinesitem> 7. The point to note here is that I use SPMETAL tool to generate the LINQ class that maps the lists . So When I try to query the lookup column it tries to add List item of the type class & that is what causing the error. Is it because I am not using datacontract in my service (but it returns the strings & all private members of machines list e.g. name,title etc) Is it making the attribute Serialisable will solve the error ??? I am kind of lost in it ...Plss help!!   Thanks

Strange Problem - SSIS Fails with "Syntax error, permission violation, or other nonspecific error".

Hello, I have a strange issue while I am deploying a package to one of the environment server. I have 2 XML Source, in the DataFlow, and one will extracted based on a value of variable that is passed from run time (package is executed from a Job) and other will be extracted all time. The next Step I have is a Execute SQL Task in ControlFlow wihich will execute after DataFlow. This has 2 input parameters and some SQL query that uses the param. Now this one fail on the target environment with below error: failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. I got the error when I did a SSIS Text File Log. Note: If I run the package in BIDS with the same XML files it work. Also when I deploy the package to my Dev Server it works. When I compare the Dev DB with the target environment DB - Both are same. The Service Acount has permission - as I can see the DataFlow task completed. Another Point: The XML Load Data Flow that executes based on the Variable Value does not execute on target environment, even if the value is passed as "True" (It is Boolean Type) But this variable is NOT an input for the Execute SQL task that fails. I am not sure w

Error calling sharepoint web services from .net 3.5 WCF client...

Code Snippet                 using (OCUserProfileService.UserProfileServiceSoapClient service =                     new TestAndDestroy.OCUserProfileService.UserProfileServiceSoapClient(GetWcfBinding())) {                     service.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;                                     PropertyData[] properties = service.GetUserProfileByName("domain\\user.name");                     foreach (PropertyData p in properties) {                        Console.WriteLine(p.Name);                        Console.WriteLine(p.Values);                    }       produces....The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://microsoft.com/webservices/SharePointPortalServer/UserProfileService:GetUserProfileByNameResponse. The InnerException message was 'Error in line 1 position 392. 'Element' 'IsPrivacyChanged' from namespace 'http://microsoft.com/webservices/SharePointPortalServer/UserProfileService' is not expected. Expecting element 'Name | Privacy'.'.  Please see InnerException for more details.   I'm totally stumped, any ideas???

Expression evaluation caused an overflow error when calling ExecuteResultSet(SqlServerCe.ResultSetOp

HelloWhen I call ExecuteResultSet(SqlServerCe.ResultSetOptions.Scrollable) I am getting the following error when the data type is Numeric(18, 4):Expression evaluation caused an overflow. [ Name of function (if known) =  ]The numbers involved are not that big and work fine when ExecuteReader() or ExecuteResultSet(SqlServerCe.ResultSetOptions.None) are called on the same SQL.Any ideas? Thanks in advance!Cheers,DaveCode:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click        Dim errorDescription As String = String.Empty        Dim numericNumber As String = String.Empty        Try            Using sqlCE As New System.Data.SqlServerCe.SqlCeConnection("Data Source = '" & My.Application.Info.DirectoryPath & "\MyDatabase.sdf';")                sqlCE.Open()                Dim sqlCECommand As SqlServerCe.SqlCeCommand = sqlCE.CreateCommand()                sqlCECommand.CommandText = "SELECT SUM(MT.TPM_Measure1) AS CurrentAmount FROM BUS_Table MT"                System.Diagnostics.Debug.WriteLine(sqlCECommand.CommandText)                Dim reader As System.Data.IDataReader = Nothing                If RadioButton1.Checked Then                    reader = sqlCECommand.ExecuteReader() 'Works fine                ElseIf RadioButton2.Checked Then                    reader = sqlCECommand.ExecuteRe

Calling a method with a class object as parameter data type.

   [WebMethod]    public string GetInfo(Customer inCust)    {        // Code in here    } I have a web service that resides on a remote server. I want to call a public method of theweb service named  "GetInfo". The method is shown above. The web service method expects a class object oftype "Customer". What I did to create a Customer object was to define in my asp.net project my own class named "Customer" which is exactlythe same as the class that belongs to the web service project on the remote server. I then created an instance of Customerand tried to call the web service passing in an object of type customer : my.Service ws = new my.Service(); // Get web service connectionCustomer aCustomer = new Customer();aCustomer.Initialize();ws.GetInfo(aCustomer) // call web service passing in a Customer object The problem is that the compiler gives me the following error: Value of type '_Default.Customer' cannot be converted to 'ws.Class1'. Here Default is refering to my Default.aspx.cs code. Why is this? Do I need to Cast my "aCustomer" class object to a type ofws.Customer ? How do I do that?

A MOF syntax error occurred - SQL Server ENT 2008 R2 on Windows Server 2008 R2

Having trouble getting SQL Server 2008 R2 installed on a Windows Server 2008 R2. Getting an MOF syntax error at this point durring the installation "SqlEngineConfigAction_install_confignonrc_Cpu64". Below is the section of the Details.txt file that includes the error. Any help on this would be greatly appreciated.   2010-07-28 10:51:35 Slp: Running: C:\Windows\system32\WBEM\mofcomp.exe "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\xesospkg.mof" 2010-07-28 10:51:35 Slp: Microsoft (R) MOF Compiler Version 6.1.7600.16385 2010-07-28 10:51:35 Slp: Copyright (c) Microsoft Corp. 1997-2006. All rights reserved. 2010-07-28 10:51:35 Slp: Parsing MOF file: C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\xesospkg.mof 2010-07-28 10:51:35 Slp: MOF file has been successfully parsed 2010-07-28 10:51:35 Slp: Storing data in the repository... 2010-07-28 10:51:36 Slp: An error occurred while processing item 17 defined on lines 201 - 222 in file C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\xesospkg.mof: 2010-07-28 10:51:36 Slp: Compiler returned error 0x800706beError Number: 0x800706be, Facility: Win32 2010-07-28 10:51:36 Slp: Description: The remote procedure call failed. 2010-07-28 10:51:36 Slp: 2010-07-28 10:51:36 Slp: Sco: Compile operation for mof file C:\Program Files\Microsoft SQL S

Error on VS 2008 Class Library project: are you missing an assembly reference?)

http://msdn.microsoft.com/en-us/library/bb153523(office.12).aspx Working with ASP.NET 2.0 Web Parts and Windows SharePoint Services 3.0 Based on the above MSDN Walkthrough, I created a Class Library VS 2008 project. When clicking the Build menu, 11 errors on System.Web.Security etc popped up.  What's wrong? *********************************************** using   System; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; Error 1 The type or namespace name 'Security' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) Error 2 The type or namespace name 'UI' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

Why do I get a 401 error when calling a WCF service from a web part?

I have a SharePoint 2010 web part and WCF service deployed to a web application using Kerberos authentication. The service was developed based on the walkthrough from MSDN with the only difference that ClientCredentialType = HttpClientCredentialType.Windows so that Kerberos is used. The web application is being reverse-published through ISA. However we've never had an issue with this before. We've also disabled the loopback check on the server. When the web part calls the service, a 401 error occurs with the following exception message: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'NTLM'. I configured Fiddler on the web application running the web part and found that both Kerberos and NTLM authentication headers are being returned: HTTP/1.1 401 Unauthorized Server: Microsoft-IIS/7.5 SPRequestGuid: 541e724c-85a7-47a0-b045-827e1c50793c WWW-Authenticate: Negotiate oXsweaADCgEBoQsGCSqGSIL3EgECAqJlBGNgYQYJKoZIhvcSAQICAwB+UjBQoAMCAQWhAwIBHqQRGA8yMDEwMDkxNDA1MjY1NlqlBQIDDgespgMCASmpDBsKREVDUy5MT0NBTKoXMBWgAwIBAaEOMAwbCnNwX3dlYmFwcDE= WWW-Authenticate: NTLM X-Powered-By: ASP.NET MicrosoftSharePointTeamServices: Date: Tue, 14 Sep 2010 05:26:56 GMT Content-Length: 0 Proxy-Support: Session-Based-Authentication Why then is the Kerberos authentication not a

EXEC 17P_Comose will give incorrect syntax error. Because of numeric name

I am working with a sql server database with about 50 stored procedures. The database and stored procedureswere not created by me. The stored procedures all begin with a number in their name. Example: 17P_Comsetter The problem I am having is that if I try and execute the stored procedure at the command line in Query Analyzer,the query analyzer appears not to like that the stored procedure begins with a number. For example: If I try an run the stored procedure as follows: EXEC 17P_Comsetter Then I get the following error message:Msg 102, ..... Incorrect Syntax near '17' If I rename the stored procedure so that it does not begin with a number, then I do not get the error. The problemis that the company I am working at has a policy in place that stored procs must begin with a number.I am using SQL server 2005. Does anyone know why I am getting this error message?

OPENQUERY Error when calling usp - object has no columns or the current user does not have permissio

Hi Guys, I need to get data using a usp, but getting error: Cannot process the object "EXEC BKS..uspPayments @paymentTypeCode1 = '1', @paymentTypeCode2 = '2', @paymentTypeCode3 = '3';". The OLE DB provider "SQLNCLI" for linked server "SERVER" indicates that either the object has no columns or the current user does not have permissions on that object. I am trying the script below: use myDB; select * from OPENQUERY([SERVER], 'EXEC myDB..uspPayments @paymentTypeCode1 = ''1'', @paymentTypeCode2 = ''2'', @paymentTypeCode3 = ''3''; ') Thanks in advance for any help. Everything is possible, impossible just takes longer

invalid syntax near '/' error


First time using parameters, not having much luck.

Keep getting 'invalide syntax near '/' when trying this code.

Any idea what might be the issue?:

string strConnString = ConfigurationManager.ConnectionStrings["WebConfigConnectionString"].ConnectionString;
            SqlConnection sqlConn = new SqlConnection(strConnString);
            SqlCommand sqlComm = new SqlCommand();
            sqlComm = sqlConn.CreateCommand();
            sqlComm.CommandText = @"DELETE FROM Assets WHERE Image = @/Images/mypic1.jpg";
            sqlComm.Parameters.Add("@/Images/mypic1.jpg", SqlDbType.NVarChar);
            sqlComm.Parameters["@/Images/mypic1.jpg"].Value = "Image";

JavaScript Error while calling a drill through report in a report viewer from a asp.net web page.


I am calling a report in a web page which is getting displayed in report viewer. This report comes fine but when I click on it to see the drill through report for this parent report the drill through report does not get displayed and I see a JScript error instead.

The error I get is something like,

parent.document.GetElementByID(...).ClientController is not null or not an object

The aspx page that contains the report viewer inherits from a master page that contains an Update Panel.

I tested the report separately in SSRS and the drill through is working fine there.

Can some one please provide any inputs on this one?



Error calling a Oracle10g function from C#.net - HELP !


I have a function which can take 2 parameters and will return a string !

my function lokks like this,

Login(uname IN varchar2,inpass IN varchar2) return varchar2

The function absolutely works fine in isqlplus !

the problem is in the .cs file....

I'm using OracleHelper !

I dont know hoe to invoke the function from C# using Oraclehelper !

i'm posting my code anyways....

string s = OracleHelper.ExecuteScalar(connection,CommandType.StoredProcedure,"Login",
new OracleParameter("uname",TextBox1.Text),
new OracleParameter("inpass",TextBox2.Text)).ToString();


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