I run following query:
Grant view database state to domain\username
and get error message
Msg 102, level 15, state 1,Line 1
Incorrect syntax near '\'
How to fix it?
View Complete Post
'constantes para auxiliar na verificaÃÂ§ÃÂ£o do cÃÂ³digo
Private Const Ascendente As Byte = 0
Hello, I've created an Expression Web form with a SQL datasource which is doing a query/select statement.
Somehow it appears that I'm making a syntax error. When I divide the query in two and execute them separate, it works fine.
I need to filter for an EventType, Region and Today's date + a custom interval (like 7 day's for a week)
The parameters come from a search form where the user can select these values via a dropdown list.
The two separate (and working) queries within my form are:
Query nr.1 :
"Select * from Events WHERE (([EventType] LIKE '%' + @EventType + '%') AND ([Region] LIKE '%' + @Region + '%'))">
<asp:formparameter DefaultValue="%" FormField="EventType" />
<asp:formparameter DefaultValue="%" FormField="Region" />
Query nr.2 :
"SELECT * FROM Events
WHERE StartDate >= DATEDIFF(DAY, 0, CURRENT_TIMESTAMP) AND StartDate < DATEADD(DAY, @NrDays, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP));">
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 ?
For your information:
I have checked in my script it is:
SET ANSI_NULLS ONGO
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:
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("firstname.lastname@example.org", "email@example.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
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"; sqlConn.Open(); sqlComm.ExecuteNonQuery(); sqlConn.Close();