I have a very weird and frustrating problem at a customer. Since two months we are busy developing a report model, so users are able to create their own reports using the reportbuilder.
Suddenly the 1:n relations seem to be screwed! If I have a simple relation between entities, like a customer can have optional multiple invoices and a invoice has always one customer..
When in reportbuilder I select the customername, invoicenumber and #Invoices, then I expect there is only one invoice per invoicenumber. (When I select this in a query myself it is the truth...) But, the reportbuilder gives 2 as a result. This suddenly happens to all my 1:n roles.
It's not only in the #invoices fields, even when i select invoice amount this amount is being multiplied by 2.
I opened a backup of my project from one month ago, with the same relation in it and try to make the same report and it gave me the right results. But ofcourse I don't want to waste a month works, so I need to get this model working!
I have SharePoint set up with the reporting services add-in on one box and Reporting Services in Integrated mode on a separate box. I thought I had it set up correctly, but when I try to deploy a simple ReportModel to the report server from VS 2005, I get the error, "A connection could not be made to the report server http://localhost/ReportServer." I looked in the log files (C:Program FilesMicrosoft SQL ServerMSSQL.3Reporting ServicesLogFiles) and found the error shown below.
I know I must have missed something in either the installation or configuration, but when I look through the SharePoint Central Admin pages and the Reporting Services Configuration Manager everything seems fine.
Thanks,
Cynthia
w3wp!library!1!03/29/2007-11:42:31:: Unhandled exception was caught: System.Configuration.ConfigurationErrorsException: Could not load file or assembly 'RSSharePointSoapProxy, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. (c:inetpubwwwrootweb.config line 68) ---> System.IO.FileNotFoundException: Could not load file or assembly 'RSSharePointSoapProxy, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. File name: 'RSSharePointSoapProxy, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)
I got a Report Model Project, in which i have created a model of my Database and deployed it on the server...
Then I have a Report Server project for my reports. The reports are using Report Model as the DataSource...
Now in the Report Designer, inside a report, when I define query for Dataset using Report Model , I can't find a way to write a left Outer Join query... It always performs Inner Joins... was wondering ether Report model supports Outer Joins ?... I might achive this using two different datasets but then i'll end up using two data regions e.g. 2 tables, but i don't want to do that... instead I want all of my data to appear in a single table which can reference to single dataset.
Is there a way to define left outer joins using Report model ? I am new to this Reporting Servces and I might be missing something here... would any body please point out that
I am reposting this to a different forum, becasue I got not response... Using VS05 SP1 Pro SQL Express€¦ Take a simple stored procedure like the following to return a specific column from a specific row in a data table .... SELECT fld_IX_UserID FROM UserIDs WHERE (fld_UserID_Table_ID = @USERID_TABLE_ID) It works fine in Store Procedure, and if you create at table adapter to reference it, that works fine as well. Here is the issue. In the store procedure (i.e. under Server Explorer), when you execute the command to test it, it gives you the correct results. In Edit with Dataset Designer, Table Adapater, if you highlight it, right click preview data, it gives you incorrect results. In code, the table adapter gives you the correct resutls. In every case, Preview Results for a table adapter built on a stored procedure will give you the wrong results. This is clearly a bug and can result in a log of wasted time. Am I missing something? FYI, I realize I don't need to use the Table Adapater to execute the above stored procedure, but we are using table adapters for everything to be consistent. Thanks, Bob
I'm working with PivotTable on Excel 2000 which is connected to an OLAP server (from SQL Server 7 installation). The pivot is intended to analyze Sales during April 2001. Yesterday I found out that OLAP/Excel returned/displayed inconsistent data. The 'April Total' value is NOT equal to the 'Quarter 2 Total' (I already inspected the underlying database and sure that there is absolutely NO data for months after April 2001). The value for 'April Total' is the correct one. I'm not sure whether the problem resides on the OLAP Server or Excel (pivot) itself. For ones who like to help me I would be glad to supply you with the screenshots (just email me). Please help.
When I double click on a database in the Enterprise Manager and the "Database Space Available" (in the Database tab) always shows 0.00 MB even though there is space available. This only happens to one of our database. The data device is 1.8GB and log device is 360MB and I've allocated all the space from device to database.
We're using SQL Server 6.5 sp3 in NT 4.0 sp3.
Anybody knows why is SQL Server reporting 0.00MB when you know there is space avaialble. I need to know the data space available and log space available so that I can expand it when the space runs low. Please help.
In several years experience with 50+ SQL Servers I have not seen this message until recently, failing integrity check jobs normally indicate a table corruption due to faulty hard disks. This message however has come up several times in the last month with our SQL 2005 SP2 sites:-
DBCC results for 'DonorReceipts'. Msg 2508, Level 16, State 3, Line 1 The In-row data RSVD page count for object "DonorReceipts", index ID 0, partition ID 49648614572032, alloc unit ID 49648614572032 (type In-row data) is incorrect. Run DBCC UPDATEUSAGE. There are 6932 rows in 103 pages for object "DonorReceipts".
We have hundreds of tables and the message is normally on different tables each time. Running DBCC UPDATEUSAGE fixes the problem but does anyone know what causes it in the first place? Shouldn't the standard maintenance plans have an option to do this already?
In my case, I have a column in a pipeline that is DT_STR with a length of 20. I'm trying to insert data from the data flow into a table (via an OLEDB destination) in which the destination column is varchar(50). When I review the metadata throughout the data flow, everything looks correct. However, I get a truncation warning stating that data loss might occur when inserting data into the string column of length 20 from a source column of length 50. Thus, it looks like the data flow is swapping the metadata for the source and destination columns when validating the data flow (and thus, producting the warning).
This is a pretty complex data flow, so I'd rather not have to rebuild it. And changing the metadata of the source column to be DT_STR with a length of 50 is going to wreak minor havoc in the data flow (as lots of things use that column).
Has anyone seen anything similar to this? The post referenced above deals with a package that is constructed programmatically, but the package I'm working with was created the old fashioned way...
I keep getting this error whenever I try to run my query: System.Data.SqlClient.SqlException: Incorrect syntax near '>'. I'm just trying to fill a dataset with three tables that contain the past few days headlines...what am I doing wrong?? Private Sub fishHeadlines() Dim dateNow As DateTime = DateTime.Now()Dim dateThen As DateTime = DateTime.Today.AddDays(-2) 'create the table array so we can create the sql statement in a moment Dim table() As Stringtable = New String() {"Snapper", "Scissor", "MahiMahi"} Dim strSelect As String 'Create a dataset to hold the tables containing the headlinesDim headlinesDS As New DataSet() 'create the connection string - SnapshotConnectionString is in web.config file Dim strConnect As StringstrConnect = ConfigurationManager.ConnectionStrings("fishConnectionString").ConnectionString 'create a connection object to the databaseDim objConnect As New SqlConnection(strConnect) objConnect.Open() Dim i As Integer 'fill the datatablesFor i = 0 To table.Length strSelect = "SELECT Event FROM " & table(i) & "WHERE (DateOfEntry > '" & dateThen & "')" 'create a data adapter object using connection and sql statementsDim objDA1 As New SqlDataAdapter(strSelect, objConnect) 'fill the dataset objDA1.Fill(headlinesDS, table(i)) Next Dim strTable As StringDim dr As DataRow strTable = "<table>"For i = 0 To table.Length For Each dr In headlinesDS.Tables(table(i)).Rows strTable += "<tr><td>" & dr(0).ToString() & "</td></tr>" Next Next strTable += "</table>" 'display the data lblHeadlines.Text = strTable End Sub
Hi everyone, If I have a table with some indexes on the foriegn keys and these indexes are heavily fragmented (80%+), is it normal for queries to return incorrect results?
For example if I had a table called Customer( CustID, Name) and Orders (OrderID, CustID, Product, Date). Lets say I have a non clustered index on CustID in Orders table, and the clustered indexes are Customer.CustID and Orders.OrderID
If the non clusterd index on Orders.CustID becomes heavily fragmented and I am querying the Orders table with TSQL "SELECT * FROM Orders where CustID = @CustID" I sometimes get missing data or incorrect results. In one case all orders for a particular year were missing, but if I queried using OderID they were returned. Rebuilding the index fixed the problem.
I know the index should be rebuilt or reorganized depending on the fragmentation but if one happened to become this fragmented should it start returning incorrect data?
I'm having Some Problem with my code....Whenever i try to insert from using a Insert button page gives me this error "System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'Plan'." Can somebody help me What's the Problem...for your convenience i'm giving my code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then End If End Sub Sub doInsert(Source as Object, E as EventArgs) Dim myConn As SqlConnection = New SqlConnection(strConn)Dim MySQL as string = "Insert into Activities (ActDate, Activity, Plan, Completed) values (@ActDate, @Activity, @Plan, @Completed);" Dim Cmd as New SQLCommand(MySQL, MyConn) cmd.Parameters.Add(New SQLParameter("@ActDate", Textbox2.Text)) cmd.Parameters.Add(New SQLParameter("@Activity", Label5.TExt)) cmd.Parameters.Add(New SQLParameter("@Plan", Textbox3.text)) cmd.Parameters.Add(New SQLParameter("@Completed", Textbox4.text)) ' cmd.Parameters.Add(New SQLParameter("@Comments", Text11.text)) MyConn.Open() cmd.ExecuteNonQuery() BindData() MyConn.Close() label12.text = "Your data has been received!" ' else ' label12.text = "Data Already Enter For This Item-Name for This Date" ' end ifEnd Sub
I have a Fact table that contains several degenerate string values that I have pulled into a Fact Dimension.
When I browse the cube and cut one of the measures by an attribute from the Fact Dimension, I am getting incorrect data.
In other words, when I query the fact table directly via SQL and apply the same filters, I see the data I am expecting to see. But cube browse with same filters yields different results.
How can this happen since the fact dimension has a 1:1 relationship with the fact table.
I do have the Dimension Usage configured properly.
Is this an aggregation thing? Attribute key thing? What am I missing?
I've read the other posts related to this issue, but I'm just REALLY confused as to whats happening in my case. Like everyone else it was working fine in SQL 2000 but now in SQL 2005 there is an issue. I'm calling a stored procedure with parameters defined like this:
When I execute the call to the stored proc I get this:
"The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 8 ("@BaseDebit"): The supplied value is not a valid instance of data type numeric. Check the source data for invalid values. An example of an invalid value is data of numeric type with scale greater than precision."
Using the VS.NET command window I then inspect that parameter to see what the heck is going on and get this:
So I set a decmial parameter to 1,000,000, that parameter in the DB is defined as decimal(28,13) so should fit no problem, but it seems the Sql data provider is confused and thinks 1,000,000 is decimal (0,22)???
This is the error it gives me for my code and then it calls out line 102. Line 102 is my buildDD(sql, ddlPernames) When I comment out this line the error goes away, but what I don't get is this is the same way I build all of my dropdown boxes and they all work but this one. Could it not like something in my sql select statement. thanksPrivate Sub DDLUIC_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DDLUIC.SelectedIndexChanged Dim taskforceID As Byte = ddlTaskForce.SelectedValueDim uic As String = DDLUIC.SelectedValue sql = "select sidstrNAME_IND from CMS.dbo.tblSIDPERS where sidstrSSN_SM in (Select Case u.strSSN from tblAssignedPersonnel as u " _ & "where u.bitPresent = 1 and u.intUICID in (select intUICID from tblUIC where intTaskForceID = " & taskforceID & " and strUIC = '" & uic & "'))"ddlPerNames.Items.Add(New ListItem("", "0")) buildDD(sql, ddlPerNames)
What I am trying to create a query to check, If recDT is not value or null, then will use value from SELECT top 1 recDtim FROM Serv. Otherwise, will use the value from recDT. I have tried the below query but it doesn't work. The error says, Incorrect syntax near the keyword 'SELECT'.Incorrect syntax near the keyword 'else'.1 SELECT 2 case when recDT='' then SELECT top 1 recDtim FROM Serv else recDT end 3 FROM abc 4 Anyone can help? Thanks a lot.
I am not sure how to fix this?? Imports System.Data Imports System.Web.UI.WebControls.FormView Imports System.Data.SqlClient Partial Class Assignment Inherits System.Web.UI.Page Protected Sub UpdateButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles UpdateButton.Click Dim empID As Integer Dim nbrID As Integer Dim equid As Integer Dim UpdateQuery Dim empequipid As SqlCommand Dim mySQLConnection As String = System.Configuration.ConfigurationManager.ConnectionStrings("DBConnectionString").ToString Dim myConnection As New SqlConnection(mySQLConnection) myConnection.Open() empID = (Session("UserEmployeeID")) equid = (Session("UserEquipID")) If CType(empID, Integer) = Nothing Then empID = (DropDownList1.SelectedValue) 'Response.Write("Insert: " & empID) 'Response.End() Me.SqlDataSource1.InsertCommand = "INSERT INTO [EMPLOYEES_EQUIP] ([EquipID], [EmployeeID]) VALUES " & equid & " " & empID & "" Me.SqlDataSource1.InsertCommand = SqlDataSourceCommandType.Text Me.SqlDataSource1.Insert() Else empequipid = New SqlCommand("Select EmpEquipID From EMPLOYEES_EQUIP Where EmployeeID = " & empID & " AND EquipID = " & equid & " ", myConnection) empequipid.CommandType = CommandType.Text nbrID = empequipid.ExecuteScalar 'Response.Write("Select EmpEquipID: " & nbrID) 'Response.End() empID = (DropDownList1.SelectedValue) 'Response.Write("<br>Update EmployeeID: " & empID) 'Response.End() Me.SqlDataSource1.UpdateCommand = "UPDATE EMPLOYEES_EQUIP SET EmployeeID = " & empID & " WHERE EmpEquipID = " & nbrID & " " Me.SqlDataSource1.UpdateCommand = SqlDataSourceCommandType.Text Me.SqlDataSource1.Update() <---Right here is displaying "Incorrect syntax near '0'."
'Added to output the Update Query UpdateQuery = "UPDATE EMPLOYEES_EQUIP SET EmployeeID = " & empID & " WHERE EmpEquipID = " & nbrID & " " 'Response.Write(UpdateQuery) 'Response.End() End If 'Updating the session to new EmployeeID Session("UserEployeeID") = (DropDownList1.SelectedValue) 'Response.Write("<br>UserEmployeeID Session: " & Session("UserEmployeeID")) 'Response.End() '-- Turn On Employee Information Table EmpInfo.Visible = True '-- Hides the Employee Name's Drop Down List table. maintable.Visible = False End Sub End Class
Hi,I am trying to test a login form and I get this error message and can't find out why. Istarted out with the Login control, but since I have to try it on the ISP's server, I can't use the SQL Server Managment Studio's integrated authentication. So, I converted the login control to a template and assigned a handler for the login button:protected void LoginButton_Click(object sender, EventArgs e){String usrname = lpLogin.UserName.ToString(); //lpLogin is the <ASP:Login ...>String conString = "Data Source=mylocalserver\SQLEXPRESS;Initial Catalog=LPRU;Integrated Security=True";String selQuery = "SELECT [Password], [FirstName], [LastName] FROM [lpUserInfo] WHERE ([UserID] ='" + usrname + "';";SqlConnection con = new SqlConnection(conString);SqlCommand cmd = new SqlCommand(selQuery, con);con.Open();SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection); // <--- it says "syntax error near ';' " on this line, I tried it without CommandBehaviorwhile (rdr.Read()){Label1.Text= rdr.GetString(0) + rdr.GetString(1); // for testing purposes, trying to print out first name and last name}rdr.Close();con.Close();}Is there a way of using SQLServer 2000, used by my ISP, and take advantage of .net 2.0's login control, roles, membership, ...? By just using a connection string?
OS: Windows2kPlatform: ASP.Net 2.0.50727DB Server: SQL Server 2000 I'm getting an error that I don't understand, could someone help me please? In the interest of brevity I threw most of the query out (it's a somewhat long join). --- query += "AND TOURNAMENT_ROUNDS.END_TIME BETWEEN ? AND ?"; System.Data.SqlClient.SqlCommand cmd = new SqlCommand(query, connection); cmd.Parameters.Add("@from",System.Data.SqlDbType.DateTime).Value = from; cmd.Parameters.Add("@to", System.Data.SqlDbType.DateTime).Value = to; SqlDataAdapter da = new SqlDataAdapter(query, connection); da.SelectCommand = cmd; DataSet ds = new DataSet(); int i = 0; try { connection.Open(); da.Fill(ds); --- The da.Fill(ds) is what's throwing. I was under the impression that ADO.Net would handle the syntax so that this shouldn't be a problem. Any idea about what direction I should be looking? If you need me to post more I'll be happy to do that. I've verified that the above is where the exception is throwing by taking out the particular AND clause, and the query worked as expected. Thanks for the help,Michael
Hi Guys,I have moved my asp.net app from access db over to MS SQL 2005 DB.And I have got a slight problem when I go to view any productfor example if I type in the url of http://domain.com/catalog/Details.aspx?AdNum=1I get this errorServer Error in '/catalog' Application.--------------------------------------------------------------------------------Incorrect syntax near '?'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near '?'.I have attached the details.aspx.I await for some suggestions.ThanksMatthew
------------------1 <%@ Page MasterPageFile="Classy.master" Explicit="True" Language="VB" Debug="True" %> 2 3 <asp:Content runat="server" ID="HeaderContent" ContentPlaceHolderID="PageHeader"> 4 Ad Detail - <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> 5 </asp:Content> 6 7 <asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="Body" > 8 9 <script runat="server"> 10 Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs) 11 If Not IsPostBack Then 12 If Request.QueryString("AdNum") = "" Then 13 Response.Redirect("default.aspx") 14 End If 15 EditLink.NavigateUrl = "confirm.aspx?AdNum=" & Request.QueryString("AdNum") 16 End If 17 End Sub 18 19 Protected Sub DetailsView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewPageEventArgs) 20 21 End Sub 22 </script> 23 24 25 <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 26 CellPadding="4" DataKeyNames="AdNum" DataSourceID="SqlDataSource1" ForeColor="#333333" 27 GridLines="None" Height="65px" Width="100%" Font-Names="Arial" Font-Size="8pt" OnPageIndexChanging="DetailsView1_PageIndexChanging"> 28 <RowStyle BackColor="#FFFBD6" ForeColor="#333333" /> 29 <FieldHeaderStyle BackColor="#FFFF99" Font-Bold="True" /> 30 <Fields> 31 <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> 32 <asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Category" /> 33 <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /> 34 <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" /> 35 <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" /> 36 <asp:TemplateField HeaderText="Email"> 37 <ItemTemplate> 38 <asp:HyperLink ID="HyperLink1" runat="server" Text=Email NavigateUrl='<%# Eval("Email", "mailto:{0}") %>' /> 39 </ItemTemplate> 40 </asp:TemplateField> 41 <asp:BoundField DataField="State" HeaderText="State" SortExpression="State" /> 42 </Fields> 43 </asp:DetailsView> 44 <p><i>To respond to this ad, just click the email address 45 above to send the poster 46 a message.</i></p> 47 If you created this ad, you can 48 <asp:hyperlink id="EditLink" runat="server" >edit or delete it.</asp:hyperlink> <br> 49 <asp:SqlDataSource ID="SqlDataSource1" runat="server" 50 ConnectionString="<%$ ConnectionStrings:classydbConnectionString %>" 51 ProviderName="<%$ ConnectionStrings:classydbConnectionString.ProviderName %>" 52 SelectCommand="SELECT * FROM [Ads] WHERE ([AdNum] = ?)"> 53 <SelectParameters> 54 <asp:QueryStringParameter Name="AdNum" QueryStringField="AdNum" Type="Int32" /> 55 </SelectParameters> 56 </asp:SqlDataSource> 57 58 </asp:content>
Can anyone see why I would get the 'Incorrect Syntax near AS' error in this? USE [SQL2]GO/****** Object: StoredProcedure [dbo].[PlanGroupGrid] Script Date: 06/18/2007 06:07:34 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER PROCEDURE [dbo].[PlanGroupGrid]@dp_id intASSELECT tblExpenses.gp_ID, tblExpenses.Amount INTO #tempApExpFROM tblExpensesSELECT tblGroups.dp_id, tblGroups.Group_ID, tblGroups.Group_Type, tblGroups.Group_Purpose, tblGroups.Group_StartDate, tblGroups.Group_EndDate, COALESCE (tblGroups.Group_Goal, 0) AS Goal, SUM(COALESCE(#tempApExp.Amount,0)) AS [Total Expenses], SUM(COALESCE (tblReceipts.AmountPaid, 0)) AS [Total Paid], SUM(COALESCE (tblReceipts.AmountPaid, 0)) - COALESCE (tblGroups.Group_Goal, 0) - SUM(COALESCE(#tempApExp.Amount,0)) AS [Total Expenses], AS VarianceFROM tblGroups LEFT OUTER JOIN tblTracking ON tblGroups.Group_ID = tblTracking.Group_ID LEFT OUTER JOIN tblReceipts ON tblTracking.gp_ID = tblReceipts.gp_ID LEFT OUTER JOIN #tempApExp ON tblTracking.gp_ID = #tempApExp.gp_IDWHERE (tblGroups.dp_id = @dp_id)GROUP BY tblGroups.dp_id, tblGroups.Group_ID, tblGroups.Group_Type, tblGroups.Group_Purpose, tblGroups.Group_StartDate, tblGroups.Group_EndDate, tblGroups.Group_GoalIf Exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tempApExp]') and OBJECTPROPERTY(id,N'IsUserTable') = 1)Drop table #tempApExp
I'm getting a pop up error "Incorrect syntax near the keyword 'ORDER'. Can someone please tell me what is wrong with my code? It worked before I added the underlined part. If FoundChecked = True Then
Dim SQLString As String SQLString = "SELECT ID, Bedrooms, Bathrooms, Location, Rent FROM ListingsTable WHERE " For Each Item In LocationList.Items If Item.Selected Then SQLString &= " Location = '" & Item.Value & "' OR " & "" & " ORDER BY Location" ----------------------This is the problem End If
Hi I'm trying to lookup a sigle value from an MS SQL Express database. However, I get an error - Incorrect Syntax near '' - when executing the code. The line in bold below is what is highlighted on the error I get back. Please Help!! The code is below Thanks Dim oSQLConn As Data.SqlClient.SqlConnection = New Data.SqlClient.SqlConnection()oSQLConn.ConnectionString = "Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|SDCentral.mdf;Integrated Security=True;User Instance=True"oSQLConn.Open() Dim ValExtract As Data.SqlClient.SqlCommand = New Data.SqlClient.SqlCommand("SELECT * FROM ProjectsQRY", oSQLConn) Dim Get1 As Int32 = CInt(ValExtract.ExecuteScalar()) Me.Active1.Text = Get1 oSQLConn.Close()
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near ')'.Source Error:
Line 42: objAdapter.SelectCommand = New System.Data.SqlClient.SqlCommand(strSQL, objConn)Line 43: ' Fill the dataset.Line 44: objAdapter.Fill(objDataset)Line 45: ' Create a new view.Line 46: Dim oView As New DataView(objDataset.Tables(0))
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim AllorOne As String Dim company As String
AllorOne = Request.QueryString("AllorOne") company = Request.QueryString("company")
' Create a connection and open it. Dim objConn As New System.Data.SqlClient.SqlConnection("User ID=******;Password=******;Initial Catalog=customer_config;Data Source=rqa4-sql01;") objConn.Open()
Dim strSQL As String Dim objDataset As New DataSet() Dim objAdapter As New System.Data.SqlClient.SqlDataAdapter()
' Get all the sql If AllorOne = "All" Then strSQL = "SELECT [Company_Name] as 'Company Name', [Entity_Code] as 'Entity Code', [YTD_Transactions] as 'YTD_Transactions', [Num_Reports_DB] as 'Num_Reports_DB', [Reports_Advanced_Workflow] as 'Reports_Advanced_Workflow', [Has_Customization] as 'Has_Customization',[TA_Trans_All] as 'TA Trans All', [TA_Trans_US] as 'TA Trans US', [Using_VAT] as 'Using VAT', [Total_Users] as 'Total Users',[Non_English_Langages] as 'Non English Langages',[Non_English_Users] as 'Non English Users', [Using_Offline] as 'Using Offline', [Using_Audit_Services] as 'Using Audit Services' from(v_customer_master_list) order by company_name" Else strSQL = "SELECT [Company_Name] as 'Company Name', [Entity_Code] as 'Entity Code', [YTD_Transactions] as 'YTD_Transactions', [Num_Reports_DB] as 'Num_Reports_DB', [Reports_Advanced_Workflow] as 'Reports_Advanced_Workflow', [Has_Customization] as 'Has_Customization',[TA_Trans_All] as 'TA Trans All', [TA_Trans_US] as 'TA Trans US', [Using_VAT] as 'Using VAT', [Total_Users] as 'Total Users',[Non_English_Langages] as 'Non English Langages',[Non_English_Users] as 'Non English Users', [Using_Offline] as 'Using Offline', [Using_Audit_Services] as 'Using Audit Services' from(v_customer_master_list) where lower(company_name) like '%" & company & "%' order by company_name" End If
objAdapter.SelectCommand = New System.Data.SqlClient.SqlCommand(strSQL, objConn) ' Fill the dataset. objAdapter.Fill(objDataset) ' Create a new view. Dim oView As New DataView(objDataset.Tables(0)) ' Set up the data grid and bind the data. SimpleDataGrid.DataSource = oView SimpleDataGrid.DataBind()
End Sub
Can anyone tell me what causes this type of error, what they think is wrong, or what IS wrong if someone wants to take the time to go through the code. Anything helps. Eh, I feel like one of those guys on a street corner with a sign when I say that.
Could someone please tell me what is wrong with the following? Thanks! Dim objcmd As New SqlCommand Dim link As String Dim pocount As Integer objConn.Open()objcmd = New SqlCommand("SELECT COUNT(PONumber) FROM (SELECT PONumber FROM BOL_Dtl GROUP BY PONumber, BOLNumber HAVING BOLNumber = @BOLNumber)", objConn) objcmd.Parameters.Add("@BOLNumber", SqlDbType.Int, 4)objcmd.Parameters("@BOLNumber").Value = Int32.Parse(Request.QueryString("BOLNumber")) pocount = objcmd.ExecuteScalar()
Hi, I have a table 'MemberPayment', into which I would like to pass a derived value, and a value from another table (table 'Vehicle', value 'Registration'). However, I keep getting errors with my syntax... would anybody be able to kindly tell me where I am going wrong? My code is;Declare @Total int Declare @Registration str SELECT (@Registration=(Vehicle.Registration), @Total=((MileageHistory.MileageUrban * Vehicle.EmissionsPerGramUrban) * 0.05) + ((MileageHistory.MileageCountry * Vehicle.EmissionsPerGramUrban) * 0.05) ) FROM [NeuCar].[dbo].[MileageHistory] JOIN [NeuCar].[dbo].[Vehicle] ON MileageHistory.Registration = Vehicle.Registration JOIN [NeuCar].[dbo].[Member] ON Vehicle.UserName = Member.UserName WHERE Member.UserName = 'wenger1' AND (MileageHistory.[Date] >= CURRENT_TIMESTAMP - 30) INSERT INTO MemberPayment (Registration, TotalCharge) VALUES ( @Registration, @Total ) Many thanks for your time, Best regards, Chima
Hi All, When binding my dropdownlist I get this error: Incorrect syntax near '?'. My code behind: 'Set country drop list value c = Request.QueryString("c") ddlCountry.SelectedValue = c 'Begin populating if country has been selected ddlLeaveType.DataBind() My HTML: <asp:DropDownList ID="ddlLeaveType" runat="server" CssClass="AdminLeaveDDL" DataSourceID="SDSLeaveTypes" DataTextField="Description" DataValueField="PTO_Leave_Type_ID"></asp:DropDownList> <asp:SqlDataSource ID="SDSLeaveTypes" runat="server" ConnectionString="<%$ ConnectionStrings:PTOTrackConnectionString %>" ProviderName="<%$ ConnectionStrings:PTOTrackConnectionString.ProviderName %>" SelectCommand="SELECT PTO_Leave_Type_ID, Description FROM PTO_Leave_Type WHERE PTO_Leave_Type_ID NOT IN (SELECT PTO_Leave_Type_ID FROM PTO_Country_Leave_Type WHERE Country_ID = ?) ORDER BY Description"> <SelectParameters> <asp:QueryStringParameter Name="CountryID" QueryStringField="c" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> If I rund the query in sql management studio and replace the ? with a valid id, it runs fine. Thanks, Mark
Could someone please explain why the above error occurs ? Dim connString As String = ConfigurationManager.AppSettings("Fleetcube.ConnectionString") Dim myConnection As New System.Data.SqlClient.SqlConnection(connString)Dim Str As String = "UPDATE [sec_Administrator] SET [EmailAddress] = ?, [Password] = ?, [SecurityQuestion] = ?, [SecurityAnswer] = ? WHERE [id] = " & Session.Item("Admin_id") Dim cmd As New System.Data.SqlClient.SqlCommand(Str, myConnection)Dim ds As New DataSetDim da As New SqlClient.SqlDataAdapter(cmd)
I am getting the error Incorrect syntax near ',' while executing a query. Here is tha code snippet.String querystring="update dbo.cstd_incident_survey set Question1="+q1+",Question2="+q2+",Question3="+q3+",Question4="+q4+ ",survey_date= '" + surveydate.ToString() + "'where incident_id='" + dr3[0]+"'";SqlCommand query4 = new SqlCommand(querystring , newconnection); query4.ExecuteNonQuery(); Please help. Thanks in advance, Sangita
some one can help me about this error..i always get the error like this..but stilll dun know exactly what the error..pls help me.. here the message
Incorrect syntax near the keyword 'user'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'user'.
Source Error:
Line 51: Dim objdr As SqlDataReader Line 52: conn.Open() Line 53: objdr = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection) Line 54: List1.DataSource = objdr Line 55: List1.DataValueField = "user_id"
I try to use stored procedure to do a search for Email column. But I always get a error "Incorrect syntax near '.'", when I input keyword like "ash11.tw." And if I put keyword without dot, it works fine. It seems like the dot caused the problem. But I dont know how to fix it. Can someone help me out? Thanks. My where expression is following. @spWhereSearch = 'where cont.Email like "%' + @Email + '%"'