SqlDataSource Configure Own SQL Statements Disabled
Dec 18, 2006
I am building a website with VS2005Standard. Onto an empty aspx page I drag a SqlDataSource control. In the "Configure datasource" dialogs I connect it with the SQL database file of my web app. In the "Configure the SQL statement" tab I select "*" for the columns and open the "advanced" dialog (I don't know the exact english terms because I use the german version) because I want to create INSERT, UPDATE AND DELETE statements separately. BUT: the upper checkbox (i.e. both checkboxes) is disabled! What can I do the get it enabled.
Hi, I just want you to know that I am very young in ASP.NET world so please bear with me.I have been looking for an answer to my problem, but unfortunately I couldn’t find one. So I created a user here on www.asp.net just for making this post. Before I continue I just want to apologies if there is another post where this question is already answered.
Please watch this Print Screen I just took: � http://www.bewarmaronsi.com/Capture.JPG “ As you can see the “INSERT, UPDATE, and DELETE Statements� are disabled, and that’s exactly my problem. I tried with an MS access database and it works perfect, but when I use a MS SQL database this field gets disabled for some reason. The MDF file is located in the App_data folder and is called ASPNETDB. And when I try to add custom SQL statements, it gives me Syntax error near “=�. Something like that. I bought the Total Training Set1 package and it works perfect in their examples. I just want to thank you for reading my post and I hope that you got some useful information for me. By the way, I’, from Sweden so you have to excuse me if my English is rusty. Thanks! PS: Can it be that I’m running windows Vista?
Hi, I am really having a hard time creating a parameter for the RadioButtonList radSearchField. I want to type 's' in the text the choose the column for the query to execute the Select statement. I was able to create a parameter for the txtSearchText but can't get the radSearchField working. My form contains four objects.
Textbox to perform the query. (name: txtSearchText)
.. the Membership ProviderUserKey value as the parameter of a stored procedure ?It seems obvious to me that you would want to do this, but I can only see that it allows you to pass Profile parameters.
I have a charting control that is fed from an SqlDataSource. How do I set the SqlDataSource to only return the top N records where N is set by a web form control?The user should have the option to chart the top 3, 5, or 10 items.Is the best approach to switch to an ObjectDataSource?
I am attempting to create search parameters for a gridview control and I am experiencing a small issue. When I get to a date parameter I am unable to display null values. I setup a sqldatasource and created the parameters below to handle the selections for minimum date required and the maximum date required for the date columns in the database. The problem is I do not know how to display null dates. Is there a way to incorporate something into the search page to show null dataes?
Sql Where Clause 1 WHERE (LSS_Requests.TypeCode = @TypeCode) AND (LSS_Requests.PersonNo LIKE '%' + @PersonNo + '%') AND 2 (LSS_Requests.TicketNo LIKE '%' + @TicketNo + '%') AND (LSS_Requests.Name LIKE '%' + @Name + '%') AND 3 (LSS_Requests.RequestName LIKE '%' + @RequestName + '%') AND (LSS_Requests.RequiredDate >= @Fromrequireddate) AND 4 (LSS_Requests.RequiredDate <= @ToRequiredDate) AND (LSS_Requests.OriginationDate >= @SearchFromOriginationDate) AND 5 (LSS_Requests.OriginationDate <= @SearchToOriginationDate) AND (LSS_Requests.LastUpdated >= @SearchFromUpdatedDate) AND 6 (LSS_Requests.LastUpdated <= @SearchUpdatedToDate) AND (LSS_Users_1.userFullName LIKE @SearchDDLUsers) AND 7 (LSS_Users.userFullName LIKE @SearchddlCIAsignee) AND (LSS_Requests.TypeCode = 'CC') AND (LSS_lu_Status.stNm LIKE '%' + @StatusName + '%')
Hello, I have SqlDataSource to retrieve a data into DetailsView, or GridView, whatever. I want to use two Select command like this: <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=AHMED-4714D04B3;Initial Catalog=mp;Integrated Security=True" <% if (( parID == 3) || (ParID ==4) { SelectCommand="SELECT [PID], [PageID], [PageContent], [ParID], [ChiID] FROM [mp_page] WHERE ([ParID] = @ParID)"> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1" Name="ParID" PropertyName="SelectedValue" /> </SelectParameters> } else {
SelectCommand="SELECT [PID], [PageID], [PageContent], [ParID], [ChiID] FROM [mp_page] WHERE ([ChiID] = @ChiID)"> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1" Name="ChiID" PropertyName="SelectedValue" /> </SelectParameters> } </asp:SqlDataSource> Is it possible to do something like that ?
I can select the tables and fields, but when I click on Advanced the Check Box to Create the Commands is not available. they are dimmed out. Why is this happening, is it a setting that I have missed. Any help is appreciated.
I have created a stored procedure with multiple select statements using MSSQL 2000. When I connect to this using a SQLDataSource it only seems to get the first SELECT. I need to access the multiple tables returned by the stoped procedure. Can anyone point me in the dirrection of how to do this.ThanksClearz
Although writing a parameterized SQL statement has been simplified using the asp:parameter options, it still may benefit to use the old fashioned method of writing a sql statement using an input string. I have noticed this for wanting to make a parameter to select which table I want to pull from. Here is some code I wrote to pull information from a database based on input from a search box and write it to a gridview. Partial Class Private_SearchResultsInherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim Table As String Dim SearchString As StringSearchString = Request.QueryString("SearchString") Table = Request.QueryString("Table") If Len(Trim(SearchString)) > 0 ThenSelect Case Table Case "Plant" SqlDataSource1.SelectCommand = "SELECT PlantName as 'Plant',PlantAddr as 'Address',PlantCity as 'City',PlantState as 'State',PlantCountry as 'Country',PlantZip as 'ZIP' FROM Plant WHERE PlantName LIKE '%" & SearchString & "%' OR PlantCity LIKE '%" & SearchString & "%' OR PlantState LIKE '%" & SearchString & "%' OR PlantCountry LIKE '%" & SearchString & "%' OR PlantZip LIKE '%" & SearchString & "%' ORDER BY PlantName" Case "Contacts" SqlDataSource1.SelectCommand = "SELECT ContactPosition as'Position',ContactTitle as 'Title',ContactLast as 'Last Name',ContactFirst as 'First Name',ContactPhone as 'Phone No' FROM Contacts WHERE ContactLast LIKE '%" & SearchString & "%' OR ContactFirst LIKE '%" & SearchString & "%' OR ContactPosition LIKE '%" & SearchString & "%' OR ContactPhone LIKE '%" & SearchString & "%' OR ContactTitle LIKE '%" & SearchString & "%' ORDER BY ContactLast" Case "Events" SqlDataSource1.SelectCommand = "SELECT EventName as 'Event',CONVERT(varchar,EventStartDate,101) as'Start Date',CONVERT(varchar,EventEndDate,101) as 'End Date',EventNotes as 'Notes',EventNoAttendees as 'Attendees',EventType as 'Event Type' FROM Events WHERE EventName LIKE '%" & SearchString & "%' OR EventStartDate LIKE '%" & SearchString & "%' OR EventEndDate LIKE '%" & SearchString & "%' OR EventNotes LIKE '%" & SearchString & "%' OR EventNoAttendees LIKE '%" & SearchString & "%' OR EventType LIKE '%" & SearchString & "%' ORDER BY EventName" Case "" Label1.Text = "Nothing Selected in Drop Down Box" End Select Else Label1.Text = "No Search Parameters Entered" End If GridView1.DataBind()End Sub End Class
Here is also my code to the front end of the page...
Hi,I'm new to ASP.NET and having a problem configuring the SqlDataSource control. I am using the standard ASP.NET 2.0 "aspnetdb" database to manage user accounts. The problem is this:When using the wizard to configure my SqlDataSource control, the option to auto-generate the Insert/Update/Delete SQL statements are grayed out. I've searched this forum and found that this can be a symptom of no primary keys in the tables. However, there are primary keys (UserId), which is the default schema as generated by asp.net (aspnet_regsql.exe). When I use the wizard, I make the following choices:How would you like to retrieve data from your database?-> Select "Specify columns from a table or view"-> Select the "vw_aspnet_MembershipUsers" view from the "Name:" drop-down list-> Select "UserId", "Email", "UserName" from "Columns:"After this, still no option to auto-generate I/U/D statements. Any thoughts on why this isn't working??? Thanks,Leah.
What is the C# code I use to do this? I'm guessing it should be fairly simple, as there is only one row selected. I just need to pull out a specific field from that row and then insert that value into a different SqlDataSource.
I must introduce myself... Kris Allain. I am a VERY new DBA. Basically I as sort of pushed into the position even though I have no previous DBA experience. I come more from a Net Admin background although I've only graduated with a degree in MIS 2.5 years ago.
With that said, I ran into a problem last week in which took down a mission critical application for 4 hours. We have an app that his highly transactional and I'm using the Full Recovery method for this DB with weekly full backups, daily differential backups, and hourly log backups. Someone (could have been me) disabled the log backup job and a couple of days later the log grew until there was no more disk space (35+ gb). Well, it took me 4 hours to back up and shrink the log and get the system up and running again.
I told my boss what had happened and now he wants to know who did it. I told him it could've possibly been me, but I highly doubt it because it appears to have been disabled between 7-8pm on my "work from home" day, which I specifically remeber packing it up and playing xbox at 4:30pm.
Could someone help me figure out what happened and if there it is possible to track these changes in the future?
Has anyone ever seen TCP/IP become a disabled protocol without manual intervention from a user?
My websites just stopped talking to my MSSQL db and when I went into sql client config utility on the web boxes, tcp/ip was disabled. Any clues? Can't find anything to support this in the event or web logs.
While in the design window of a table, I click the properties button and click the Relationships tab. Here everything is grayed out, and I can't drag and drop to create relationships in my Diagram either. Its like things are locked up right now. Can any of you give me some direction? thanks
My production database has a maintenance plan that rebuilds all indexes and it's scheduled to run every day at 5 AM.
I disabled some nonclustered indexes that were not used by any execution plan I found, and run a Profiler session to catch any negative impact in performance.
But I found that the indexes were re-enabled the next day by the Rebuild Index task from the maintenance plan.
Is there a way to keep those index disabled? I don't want to drop them as I could have to re-enable some of them by users' request.
hi, all my toolbars except for the standard toolbar in SSRS are disabled. I cannot use anything. For example, I selected the formatting toolbar and it appears on the bottom of the standard toolbar, but I cannot select anything because it's all greyed out. Any suggestions. Thanks.
Environment: Visual Studio V8.0.50727.42 (RTM.050727-4200) Installed Products: Visual Studio Team Explorer V8.0.50727.127
The Variables are not available to the IDE. I cannot 1) Open the Variables Window (View > Other Windows > Variables), 2) Add or Edit Variables (SSIS > Variables).
I am preparing to re-install Visual Studio. Has anyone else seen this behavior? Is it a "feature" of some sort?
I having problem of using SQL Server management studio to create a database. Database have alot of colume, if i want to make column 1 to disabled, may i know how to set it?
The report functionality is working fine with the provided parameters,but the problem is one of the parameter Asofday is getting disabled until then servername and drive are provided and a click on the other remaining three parameters.
i have default for this asofday for today, and i feel that because of default parameter only it is getting disabled. i removed the default and is working fine wihtout getting disabled.
As this Asofday is of thirdplace in parameters list, i moved it to firstplace,it works fine here also.
What is happening when i supplied default and moved to third place?
If any one of you experienced any issue like this.pls share .
Hi, I'm using SQL Server 7.0. I'd like to know if there is anywhere in the information schema or system tables where I can tell that a constraint has been flagged as 'enable constraint for INSERT AND UPDATE' or not.
I have several alerts set up and a job setup to notify via email if alerts occur. There are times when I might be doing maintenace on a box that may generate alerts but I don't want to get emailed or paged for these "dummy" alerts. I thought first of setting the enabled column of sysalerts to 0 - that doesn't work. I still get notified. Then I thought I'd set the enabled column in sysjobs for my notification job to 0 while I'm doing the work. But as soon as I re-enable the job I get an alert. It seems that as soon as the job is re-enabled it checks the NT application log and sees that an alert was fired and somehow knows that there was no notification sent so sends one. If I purge the NT application log before re-enabling the job is solves the problem. But that is a very in-ellegant solution and I don't want to loose all the info stored in the event log any way. Does anyone know how SQL SErver aggent keeps track of this stuff? (ie. that an alert was fired but it's response job is disabled and to check once a job is re-enabled to see if any alerts occured while it was disabled?) I did a Profiler trace while re-enabling the job but didn't see anything pertinant in there.
1) SQL Executive stops running jobs 2) The only way I can get it to START running jobs is to reboot the server 3) When SQL Server and executive come back up, a number of the tasks have been DISABLED! (I have seen this happen over and over on my SQL 6.5 SP4 instances.)
If you have seen this situation, have you found a way to prevent it? (ie: procedure or bug fix, etc.)
Just curious to hear if anyone else has experiences this or knows a reason why it maybe should be this way...
I have some jobs that are disabled accourding to the Job Activity Monitor view in Mgmt Studio. However, if I open the schedules details, this view says Enabled. Can a schedule be enabled for a job, even if the job in itself is disabled maybe? But, I can't see any enable/disable flag in the sysjobschedules table, only in sysjobs.
Hi, I have been scheduling jobs from past couple months on production but it does not execute on the scheduled time.
I checked the schedule enabled tab, it was enabled when i scheduled the job, but was disabled at a later date when i checked to see why the job did not run.......
Can some one please guide me if there is any process in SQL which disables the jobs automatically.
I want to find out how the jobs when scheduled and enabled gets disabled on its own.
Is there something that would cause a SQL Login to get disabled automatically? The login was used successfully yesterday but today we were getting an error:
Login failed for user '<sql login>'. Reason: The account is disabled. [CLIENT: ipaddress]
Perhaps someone accidentally disabled this but that sounds unlikely.
I didn't see anything in the log about the account getting disabled.
my SB configuration involves 3 servers. Server A sends a message to Server B. there's a stored proc on Server B that is being activated (using Activation), does some processing and sends the message to server C. on C there's another SP that is activated and it's supposed to insert a record into a table.
My problem is that on Server C, the record doesn't get inserted when activation is set to ON.
when activation is off on C and I run the proc manually, everything works fine, but when activation is on, the record doesn't get inserted. after this happened I tried to fire the proc manually and I got the following error :
Msg 9617, Level 16, State 1, Procedure spMSG_ReceiveMessagesOnSubscriber, Line 52
The service queue "TargetQueue" is currently disabled.
I am using the following code for activation on server C :
I have an event in my sql server 2005 box that is fired every 5 seconds. Source MSSQLSERVER event ID 9274.
The activated proc [dbo].[sp_sysmail_activate] running on queue msdb.dbo.ExternalMailQueue output the following: 'The service queue "ExternalMailQueue" is currently disabled.'
I don't know anything about this queue that is mentioned above. How do I disable this message or get rid of that queue?
I receive messages in my target queue but target queue continously become disabled even aften I enable and receive message it still says target queue is disabled?
Should I disable IIS on SQL Server 2005? Is there any reason that I should keep it around? I know that it is necessary for reporting services, but our database servers are on a seperate server from our reporting server. We have reporting services running on a stand alone box by itself.