SQL Server :: Not Identifying Quote When Executing Query?

Sep 30, 2010

Im using SQL Server 2008 R2, Server version 9.0 SP3Im trying to do a replace on a comma seperated values before submitting to the "IN" condition.

[Code]....

[Code]....

View 2 Replies


Similar Messages:

SQL Server :: DataAdapter/SQLDataReader Takes Lot Of Time For Executing A Query?

Aug 31, 2010

I have a webpage with 6 drop down lists. User can start with selecting any drop down list first, and then proceed in any order. 1. Assume when the 1st dropdown is selected first, rest 5 drop downs (except 1st) are filtered/updated based on the selected value in the 1st dropdown.2. Assume user selects the 4th dropdown second, rest 5 drop downs (except 4th) will be filtered/updated but the condition would be based on both 1st drop down and 4th drop down. But while filtering the first drop down, only the 4th drop down is used as filter (self-filter will be ignored).

The code works fine but I see a very bad performance hit in time when the user selects the fourth dropdown after selecting three drop downs. I tried using both SQLDataAdapter and SQLDataReader but neither used to solve the issue. The code takes a lot of time on one line in either of the code (which is highlighted below). When I run the query in SQLServer Mgmt Studio, the query completes in a few seconds.

[Code]....

View 5 Replies

C# - Nhibernate - Getting Exception Executing SQL Query?

Apr 20, 2010

I am excuting SQL Query using Nhibernate, here is my code

public ArrayList getDocumentsForApproval(string ReleaseId)
{
string query = string.Format("SELECT distinct doc.Id, doc.Name as Doc, doc.url as url, suser.Name as Author, ds.name, CONVERT(VARCHAR(11), doc.DateEntered, 101) as DateEntered FROM dbo.Documents doc INNER JOIN DevelopmentSteps ds ON doc.TypeId = ds.Id INNER JOIN DocumentTrackingItems dti ON doc.Id = dti.DocumentId INNER JOIN TrackingItems ti ON dti.ItemStepId = ti.Id INNER JOIN dbo.Releases rl ON ti.ReleaseId = rl.BugTrackerName left outer join (select * from users) as suser on doc.AuthorUserid = suser.Id WHERE doc.DateEntered IS NOT NULL AND doc.DateApproved IS NULL AND rl.ID = '{0}'", ReleaseId);
ISession session = NHibernateHelper.GetCurrentSession();
ArrayList document =(ArrayList) session.CreateSQLQuery(query).List();
return document;
}

Exception Details:

NHibernate.QueryException: Return types of SQL query were not specified [SELECT distinct doc.Id, doc.Name as Doc, doc.url as url, suser.Name as Author, ds.name, CONVERT(VARCHAR(11), doc.DateEntered, 101)

View 1 Replies

DataSource Controls :: Executing SQL Query In Background?

Feb 2, 2010

I have an article submission system on my website whereby a user inputs a bunch of information and submits it to the database. After the user presses the "submit" button, apart from submitting the article to the database, I want to also execute another rather large SQL query that inserts additional data into a seperate table.

However since this execution may take a while, I do not want the user to have to wait for the query to be successfully completed before they are forwarded to the "submissionsucess.aspx" page. In other words I would like the larger sql query to take place while the user is still on the website. So I was wondering if there is a way to do the following:

1. User submits article.

2. Simple submit query is executed.

3. Submit query is finished...start complex longer query (takes time).

4. User is forwarded to success page, user then continues to browse website. Complex query still executing at the same time, while user browses website.

5. Complex query is finished.

View 4 Replies

Executing A SQL File Or Query Via A Submit Button?

Jan 28, 2010

I'm trying to figure how to on a submit button execute an sql file.

We have a job recruiting application, and for the subsidiaries companies they all have their own database setup for the jobs. At night the application has a consolidator script built in to pull all the jobs posted in those companies and load the posting into the parent companies website job listing. This listing will then point back to the Subsidiary website for the applicant to apply.

The issue with that script is the time it took to execute which is 20hrs to run as a scheduled task. We have created a more efficient script and would like to place a submit button in the admin panel for the HR recruiters to click which will automatically upload their updated job listings to the parent company.

So what would be the proper coding framework to use on the submit form to execute our new consolidator sql script?

View 3 Replies

ADO.NET :: [Entity Framework] Strange Error Executing A Sql Query

Nov 29, 2010

I have a strange error, I've tried to search for it before writing this post but I wasn't able to find out a solution yet.

I'm executing a query using ExecuteStoreQuery against a MySQL database, but it throws an exception reporting that there's a syntax error in my SQL.

I've tried to copy&paste the sql query into the MySQL tool and it works nicely, giving the correct results.

I've tried to open manually the connection and using CreateCommand to use it the "old way".

My query is a bit long, 4000 chars more or less, could it be the problem?

View 4 Replies

DataSource Controls :: Internet Connection Loss While Executing Query?

Jun 23, 2010

I am having problem in diffrentitate error between internet connection loss error and Other Error in query for example: duplicate record found.

Both the error fall into System.Data.SqlClient.SqlException category.

But the way to handle both this 2 error is different.For connection error , i need to bring user to connection loss page while for duplicate record found error, i need to show the user a pop up.

Unless i do a checking exactly on the error message , else i have no ways to differentiate connection loss error and any other error. Am i correct for this?

View 1 Replies

SQL Server :: Error While Executing A Dynamic Insert Sql Storedprocedure In Sql Server 2005?

Jan 4, 2011

assist me rectifying the error in following sql stored procedure?

Sql Query:- [Code]....

I have created the above Stored Procedure for inserting datas into any table but while I execute the above proceedure its throwing some error.

View 4 Replies

Web Forms :: Identifying Cause Of Postback?

Oct 29, 2010

Say I have a single page/form with a search facility (i.e. a textbox plus 'Go' button) and a login facility (username, password and 'Login' button).

Is it possible to identify within the Page_Load event which button the user has clicked - i.e. 'Go' or 'Login' - can I somehow use the 'Source' and/or 'e' parameters to identify this?

I can direct both buttons to different OnClick event handlers or direct both to the same handler and identify the button using the Id or text properties but I'm curious to know whether the button can be identified at the Load stage.

View 4 Replies

.net - Identifying The Aggregate Roots?

Mar 9, 2011

Let us assume the following relationships (diagram). A FundCompany has Funds, and Accounts. There is also a FundAccount which creates a many-to-many relationship (as well as other attributes at the relationship level) between Accounts and Funds. Lastly an Account has one or more Beneficiary.The FundCompany is an aggregate root as it's at the top of the pyramid. Neither Account nor Fund can exist without the FundCompany. FundAccount cannot exist without both Fund and Account; does that make them both aggregate roots? Or is Fund still the only aggregate root, having to go through it to perform operations on FundAccount entities? The fact that the Account also has Beneficiaries, which cannot exist without the Account, does that also signal Account being an aggregate root?

All of the entities on this diagram will require CRUD operations and screens in my application. The reason I'm bringing this is up is most often every UI screen will store the ID of the row/entity it's referencing. So for example a user clicks "Details" on a table with Funds, I might need to retrieve a fund via its ID. My understanding is that if an entity needs direct access then it's an aggregate root in itself. However this would make a lot of entities aggregate roots by default.Based on the answers to above questions I have to map these operations to the proper aggregate root's repository.

View 1 Replies

AJAX :: Identifying A Namespace Used For 'slideShow'?

Jan 21, 2011

I'm using Visual Web Developer 2008 Express Edition, coding in C#. I think that the framework that I am aiming for is 2.0.

I am working on some old projects here where I work. However, I do not have access, nor do I know what the original programmer used to write this code.

The following code gives me an error:

[Code]....

(note that SlideList is an ArrayList that is being assigned to a DataSource. Also, this code is found inside a function named "CreateFeaturedSlideShow", which is called by the function "Page_Load" in "default.aspx.cs")

When I try to compile the project I get this error code: "The type or namespace name 'slideShow' could not be found (are you missing a using directive or an assembly reference?)"

When I comment out the code, the project compiles. However, when I try to run it, I get another error message: "Only one of AdvertisementFile, DataSource, or DataSourceID properties can be set on AdRotator 'AdRotator1'. "

From examing the rest of the code, it seems like this part of the project is populating a database with advertisement data, and selecting an ad at random, and keeping track of various statistics.

My problem is that I am having difficulty locating anything that will give me a slideShow namespace. The top result seems to be the SlideShow Extender, but after adding this toolkit to my toolbox nothing changed, which leads me to believe that I have something else.

Does anybody know where I can find this 'slideShow' that is referred to in the code?

View 2 Replies

Executing Javascript From The Server Code?

Feb 16, 2011

Here is what I need to do: I need to execute some server side code after a user clicks on a button, THEN I need to execute some client side code. OnClientClick gets invoked BEFORE the onClick; and what I need is the opposite.

Is there a way to do this? It looks like I will have to execute JS code from the server code.

View 1 Replies

C# - Executing Program On Server-side?

Jul 14, 2010

I have an executable file that works fine by hand locally. It converts a file to another new file by some parameters. I'm using ASP.Net and that executable installed win2003 server sp2. I can use it from local but, I can't execute the program from a web browser using system.diagnosting.process. When I use that, I can see the process in task manager with user name "NETWORK SERVICE", and it won't dissappear without ending process by hand and won't work. I tried impersonation, try as a web service, edited local policies, apply all privilages, etc...

View 1 Replies

Web Forms :: Identifying Browser Back Button And New Tab?

May 10, 2010

How to recognize if user has come through browser back button in asp. net site

AS well how to identify if they have opened new tab in the same browser.

View 1 Replies

Web Forms :: Identifying Which Button Is Clicked In A WebPart?

Feb 8, 2010

In a WebPart class, I have one label and two buttons. When a button is clicked, I would like the label to identify the clicked button.

I have the code:

Private Sub TestWebPartClass_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.PreRender
Dim Label1 As New Label()
Dim Button1 As New Button()
Dim Button2 As New Button()

[Code]....

How do I now add (in VB please) the event handlers so that, when a button is clicked, Label1 identifies the clicked button.

View 2 Replies

Web Forms :: Executing Exe From Server Doesn't Work

Dec 31, 2010

Why this doesn't work?

[Code]....

Error: The HTTP verb POST used to access path '/WEB_Salaries/Programs/CALC.EXE' is not allowed.

View 5 Replies

SQL Server :: Executing A Stored Procedure From Select?

Aug 9, 2010

Let's say I have a query like this:

[Code]....

But I want to call a procedure (DeleteUser) for every rows returned from that query.

And of course the procedure has a parameter. But it should be the UserID which is returned from query.

So how to do it?

View 3 Replies

SQL Server :: Error While Executing A SQL Scalar Function?

Nov 1, 2010

CREATE

FUNCTION dbo.ufnGetProductReport(@Pid
int)

RETURNS int

AS

BEGIN[code]....

This is the program. When im trying to execute it with Select * from dbo.ufnGetProductReport(1)

im getting an error Invalid object name ufnGetProductReport

View 2 Replies

Visual Studio :: Identifying Unused Properties In The Project?

Feb 17, 2010

i am working on asp.net application using C#, identifying properties that are unused in my project. in Code analysis tool i am able to see unused private fields getting reported (Avoid unused private fields), but is there any such facility too for unused Properties declared in the class.

View 3 Replies

Security :: Identifying Users Uniquely Via A Guid Or Other Techniques?

Oct 14, 2010

I am in the process of building a survey using asp.net and store these results into a database. Now this is what I am trying to achieve: - The survey is fairly long but will be split up in sections. - the way I have been told to develop this is to save each section into the database when the user clicks on a next button for example rather than clicking a final submit button and then submitting the results all in one go to the database. The reason being is for example, the user's browser crashes etc or if they accidentally close it down. I need to build it such a way that survey can remember who the person is.

I can't use windows authentication as it will be externally based, is there anyway I can uniquely identify people when they arrive on the web application e.g. by using a guid? Can it be guaranteed that the person who arrives on the application with a guid on that machine be exactly the same when he/she arrives again?

View 2 Replies

DataSource Controls :: Identifying Duplicates In Data Upload?

Mar 3, 2011

Using SQL server and C# to build my web site. I need to do a bulk upload Employee data from Excel to SQL.

I use the following code to perform this. The code works fine.

[Code]....

In the Employee table there is a field called ID which is of type int and auto incrememntral . This is the primary key.

There cannot be duplicates in the combination of EmployeeName and Location. If the user tries to upload ( through the Excel file) the combination of EmployeeName and Location which is there in the database, I need to flag it.

How can I identify the duplicates in an easy way rather than going through all the records again and again? Any functaion in SQL I can use to identify the duplicates?

View 4 Replies

AJAX :: Server Code Executing Twice With Control Toolkit

Jan 24, 2011

I am using following server side code to save the data from ASP.NET Control toolkit Editor to the database It follows with the HTML Code The problem is that, data is saved successfully. But it is saved twice. Main problem is this server side event is fired twice. How can i prevent it from firing twice?

Server side code
Imports System.Data.SqlClient
Partial Class Administrator_Calendar
Inherits System.Web.UI.Page
Protected Sub BtnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnAdd.Click
Try
Dim dbobj As New db
Dim i As Integer = 0
Dim rdr As SqlDataReader = dbobj.selectQuery("select max(srno) from calendar")
If rdr.HasRows = True Then
rdr.Read()
i = rdr.Item(0)
End If
rdr.Close()
dbobj.insertQuery("insert into calendar values (" & i + 1 & " , '" & Me.Txt_dt.Text & "' , '" & Me.Editor1.Content & "')")
dbobj = Nothing
Catch ex As Exception
End Try
End Sub
End Class
HTML CODE
<%@ Page Language="VB" MasterPageFile="~/MasterPages/Admin_AftrLogin.master" AutoEventWireup="false"
&nbsp;&nbsp; &nbsp;CodeFile="Calendar.aspx.vb" Inherits="Administrator_Calendar" Title="Excel Crop Care Ltd. / Administration Section / Manage Calendar..." %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
&nbsp;&nbsp; &nbsp;TagPrefix="cc2" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
<div>
<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">
<cc1:TabPanel runat="server" HeaderText="Selected Dates" ID="TabPanel1">
<ContentTemplate>
<asp:GridView ID="Gridview1" runat="server" AutoGenerateColumns="False" DataKeyNames="srno"
DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True">
<ItemStyle Width="20%" />
</asp:CommandField>
<asp:BoundField DataField="srno" HeaderText="No." ReadOnly="True" SortExpression="srno">
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField DataField="date" HeaderText="Date" SortExpression="date">
<ItemStyle Width="30%" />
</asp:BoundField>
<asp:BoundField DataField="description" HeaderText="Description" SortExpression="description" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%&#36; ConnectionStrings:DataConnectionString %>"
SelectCommand="SELECT * FROM [calendar]" UpdateCommand="Update calendar set date=@date,description=@description where srno=@srno"
DeleteCommand="Delete from calendar where srno=@srno"></asp:SqlDataSource>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Add New">
<ContentTemplate>
<table>
<tr>
<td width="30%">
Date :
</td>
<td>
<asp:TextBox ID="Txt_dt" runat="server" Height="16px" Width="170px" CausesValidation="True"
Font-Names="Verdana" ForeColor="#666666"></asp:TextBox>
<asp:ImageButton runat="Server" ID="Image1" ImageUrl="../Images/Calendar_scheduleHS.png"
AlternateText="Click to show calendar" /><br />
<cc1:CalendarExtender ID="Txt_dt_CalendarExtender" runat="server" DaysModeTitleFormat="dd/MM/yy"
Enabled="True" Format="dd/MM/yy" TargetControlID="Txt_dt" PopupButtonID="Image1">
</cc1:CalendarExtender>
<cc1:TextBoxWatermarkExtender ID="Txt_dt_TextBoxWatermarkExtender" runat="server"
Enabled="True" TargetControlID="Txt_dt" WatermarkText="DD/MM/YY">
</cc1:TextBoxWatermarkExtender>
<cc1:MaskedEditExtender ID="Txt_dt_MaskedEditExtender" runat="server" MaskType="Date"
CultureDateFormat="dd/MM/yy" Enabled="True" TargetControlID="Txt_dt" Century="2000"
UserDateFormat="DayMonthYear" Mask="99/99/99">
</cc1:MaskedEditExtender>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="Lbl_msg" runat="server" Text="Enter description in the editor below :"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<cc2:Editor ID="Editor1" runat="server" Height="350px" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="BtnAdd" runat="server" Text="Add" OnClick="BtnAdd_Click" Width="75px"
CssClass="btn" />
<asp:Button ID="Btn_Rem" runat="server" Text="Remove" OnClick="BtnAdd_Click" Width="75px"
CssClass="btn" />
</td>
</tr>
</table>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
</div>
</asp:Content>

View 1 Replies

Custom Server Controls :: Case Statement Is Never Executing?

Aug 25, 2010

why the case statement is never running

[Code]....

[Code]....

View 3 Replies

FadeIn / FadeOut Div Tag After Executing Some Server Side Code?

Jul 23, 2010

Here is my code

<div id="AuthenticateUser" runat="server" style="display:block" >
//login control
<asp:button id="ValidateUser" ... />
</div>
<div id="ForceToChangePassword" runat="server" style="display:none" >
//reset password control
</div>

On click of "ValidateUser" button, I do check whether user is valid or not. Based on some condition I do need hide "AuthenticateUser" div tag and show "ForceToChangePassword" div tag. I really like the jQuery fadeIn/fadeOut effect. I can easily do that on client side. But how can I give that effect after executing server side code?

I tried to call javascript method from code behind that method has a fadeIn/fadeOut logic but it seems like that javaScript method is never been called.

View 4 Replies

SQL Server :: Executing An SSIS Package From VB.NET Web Application From The Client Desktop

Oct 20, 2010

I want to ask the following:

Does anyone have an example of some code which executes an SSIS package from a ASP.NET web app using VB.NET?

I have built a web application and want to be able to execute the SSIS package when the user clicks a button on the web page.

So far I have:

[code]....

I need to know how to set this up so it runs remotely. I have searched MSDN (useless), [URL] and sqlservercentral.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved