SP Compilation Confirmation Message?
How can we say whether the SP is successfully compiled or not if we are compiling it on the server as a part of the TSQL script since it does not throw any message like ORACLE does.
In oracle, system will let you know whether the the procedure is successfully complied or not?
Thanks/
View Complete Forum Thread with Replies
Related Forum Messages:
Need Confirmation
I am working with a client who has all databases, logs, tempdb and user/system databases on a single raid set. In order to make some speed improvement, we have decided to move log files to a second raid controller card. To accomplish this, we are thinking about taking these steps: 1) Detach database XYZ. 2) Stop database service. 3) Create a new partition on new controller card. 4) Copy old log files from I: to new K: drive. 5) Remove drive letter I: from system. 6) Change drive letter K: to I: 7) Attach database My question is, does SQL Server recognize the log files automatically, since they are placed at same logical position (i: drive)? Peter Larsson Helsingborg, Sweden
View Replies !
Confirmation Please
I have a task to perform a new SQL Server 2005 installation at a client. They have a system with 10 external SCSI drives, each of 72GB. They only have one database of 80GB in use at this system. 1) Userdata: I think that I will put 5 disks at SCSI channel 1, with RAID 3 or 6, with formatted space of 140GB. 2) Log: I think that I will put 3 disks at SCSI channel 2, with RAID 5, with formatted space of 70GB. 3) TempDB: I think that I will put 2 disks at SCSI channel 3, with RAID 0, with formatted space of 140GB. System already has two built-in drives (RAID 1) for operating system, where I think I will put system databases. I am open for suggestions and improvements! Peter Larsson Helsingborg, Sweden
View Replies !
Confirmation Of Success
Just a thought. If an issue is resolved please note that the problem has been resolved. Because there are "many ways to skin a cat" it would be helpful to anyone else with a similar problem (or someone trying to learn) what the solution was.
View Replies !
Looking For Confirmation/clarification
Looking for a clarification When I throw this code from my workstation (SRV1 stands for a remote server) pkg = app.LoadFromSqlServer("Maintenace Plansfirst", "SRV1", Nothing, Nothing, MyEvents) That means that my package allocated remotely WILL RUN there no in my local. Moreover, it will run by means of my AD user (user and password own nothing) As a last comment, my own user domain might have db_dtsadmin as server role, otherwise execution will fail. Thanks in advance,
View Replies !
Compilation Error
I'm trying to connect to an SQL database through my asp.net page and I'm getting an Compiler Error Message: BC30188: Declaration expected for the following codes: DBConn= New OledbConnection("Provider=sqloledb;" _ DBInsert.Commandtext = "Insert Into GuestInfo" _ DBInsert.Connection =DBConn DBInsert.Connection.Open DBInsert ExecuteNonQuery() What I'm trying to do is connect to the SQL database and input new information to the database. This is the entire code for connecting and entering info into the database. The SQL Database's name is HMS. I'm stuck and I can't figure it out. Dim DBConn as oledbConnection Dim DBInsert As New oledbCommand DBConn= New OledbConnection("Provider=sqloledb;" _ & "server=localhost;" _ & "Initial Catalog=HMS;" _ & "User id=sa;" _ & "Password=yourpassword;") DBInsert.Commandtext = "Insert Into GuestInfo" _ & "(FirstName,Lastname,Address,City,State,Zipcode) values ('" _ &"'" & txtFirstName.Text & "', " _ &"'" & txtLastName.Text & "', " _ &"'" & txtAddress.Text & "', " _ &"'" & txtCity.Text &"', " _ &"'" & txtState.Text &"', " _ &"'" & txtZipCode.Text &"', ")" DBInsert.Connection =DBConn DBInsert.Connection.Open DBInsert ExecuteNonQuery()
View Replies !
Prevent SP Compilation
Hi,I'm using SQL Server 2000 MSDE on a laptop running Windows XP.I have a couple of SP's that that quite some time to compile. So I waswondering: is there any way to have the database *not* recompile them everytime after a reboot?BOL says: "As a database is changed by such actions as adding indexes orchanging data in indexed columns, the original query plans used to accessits tables should be optimized again by recompiling them. This optimizationhappens automatically the first time a stored procedure is run afterMicrosoft® SQL ServerT 2000 is restarted."Now the SQL Server is restarted a lot, because laptops don't have endlessbatteries <g>Cheers,Bas
View Replies !
Avoiding Compilation
Using small stored procs or sp_executesql dramatically reduces the number ofrecompiles and increases the reuse of execution plans. This is evident fromboth the usecount in syscacheobjects, perfmon, and profiler. However I'm ata loss to determine what causes a compilation. Under rare circumstances theusecount for Compiled Plan does not increase as statements are run. Seemsto correspond to when there is no execution plan. It would seem to me thatcompilation is a resource intensive task that if possible (data and schemaare not changing) should be held to a minimum.How does one encourage the reuse of compile plans?Is this the same as minimizing compilation?Looks like some of this behavior is changing in SQL 2005....Thanks,Danny
View Replies !
DTS Packages- Seeking Confirmation
Hello all, I have 2 primary key fields the ssn and refnum... if the data in the file is duplicated it will not import to my table rights even though i am using DTS to do my import, correct? or do I need to add an extra validator in there?
View Replies !
MSDE Confirmation Question
We have a project at work that requires us to run an msde database from cd. My sup. and I disagree on if this can be done or not. We currently have an application written in asp that uses an access db. We copy the *.mdb file and all the asp files to cd and use the app. to query the db. Now, we have a client who wants the same capability only using msde. They will not allow us to install the full version of sql on there machines. No one in the dept wants to re-write this app. so we're trying to figure out if we can make it work with msde. So, My first question is, does anyone think that it is possible to just copy the *.mdf file to cd (mind you WITHOUT the *.ldf file... can't write to a cd)andMy second question is, can a sql db run without both files in any situation(mdf,ldf)? (I believe this is impossible, but would like to here it from someone with more experience)Any comments are greatly appreciatedthanks
View Replies !
Help: Table Lock Confirmation
I need confirmation from you SQL Server experts out there. Please let me know if the following works. Thanks! This stored procedure gets a value and increments by 1, but while it does this, I want to lock the table so no other processes can read the same value between the UPDATE and SELECT (of course, this may only happen in a fraction of a second, but I anticipate that we will have thousands of concurrent users). I need to manually increment this column because an identity column is not appropriate in this case. BEGIN TRANSACTION UPDATE forum WITH (TABLOCKX) SET forum_last_used_msg_id = forum_last_used_msg_id + 1 WHERE forum_id = @forum_id SELECT @new_id = forum_last_used_msg_id FROM forum WHERE forum_id = @forum_id COMMIT TRANSACTION
View Replies !
TCP/IP Support Confirmation - IMPORTANT
Hello: I need important information on how to confirm that 1) SQL Server has TCP/IP support enabled (via a remote connection i.e. winnt/system32 directory.) I can't currently get to the physical machine to run the setup. I notice that on the server i cannot locate the DBMSSOCN.DLL in the system32 directory (does this indicate that it is not enabled?) DBNMPNTW.DLL is there, for named pipes Also, i need to confirm that a client connecting to the server (via ODBC)is using the TCP/IP Protocol. THIS INFORMATION IS VERY IMPORTANT FOR ME TO FIND OUT, AS IT AFFECTS OUR PRODUCTION ENVIRONMENT. Thank you in advance.
View Replies !
Registration Confirmation Best Practice?
Hi. I am about to write my registration confirmation tables. Right now I have my registration form and table "Users" that receives input from user registration. I want to do email confirmation of a registered account. I was thinking of doing this by creating a table "Verify" that is set to 0 if not verified and 1 if the user verifies his email address. Then I started thinking about the original registration information. If a user "doesn't" verify, then there is all this dormant data in the "Users" database. So, maybe it is better to write all the registration data to the "Verify" table and then have SQL move that data to the "Users" table upon verification? This sounds a bit sloppy to me... is this how the email verification of data is done or, if not, can somebody suggest a best practice? I thank you.
View Replies !
Native Client Confirmation
Hi How can I check "Native client" is present on my client? I'm trying to eliminate all the reasons my client won't run a VC++ app which access a sql server. thanks Z
View Replies !
Unique Confirmation Number
Hi to alll of you, i'm working in a project to save cars information, when the user who adds on the new record enter all the data, this will need to be printed with a particulary number, which needs to be unique, (lets take a passport number as an example) this generated number will takes some info from the filling fields, for example: Cars Brand: BMW (catalog number: 120) Cars Model: 325 (catalog number: 30) Year: 2008 (catalog number: 18) So the unique certification number will takes from the catalog numbers * 20 / 5 for example for cars Brand for Cars Modelo: catalog number *3 + 15 CERTIFICATE NUMBER: 480-105 I'm not sure if this is possible. I will realy thanks for your help in this issue. Best Regards Gian
View Replies !
Compilation / Re-build Issue
Hi, We are using .Net 2.0 for developing our application, All the file in this application are source safed, Whenever we do modification in the code it take longer time to build approax it takes around 2 min to display the default page (login page). Please do send out your suggestions to reduce the time take for the build, is there any setting need to be done in IDE to make the build process much faster. Regards K.Karthik Doss
View Replies !
SQL Compilation And Execution Plan
Hi all, I€™m having a test regarding to the image data type. The test program is written with sql native api and just update the image data type column, but I looked the SQL Compilations/sec and Batch Requests/sec counters in SQLServer:QL Statistics using Perfmon, both values are almost the same. It seemed whenever the stored procedure is called, SQLServer compiles it and makes execution plan again. But when I had a test without image data type, SQL Compilation/sec was 0. SQL version is Microsoft SQL Server 2005 - 9.00.3054.00 (Intel X86) (Build 2600: Service Pack 2). Is SQL server working the way expected or am I missing something?
View Replies !
Compilation Of Stored Procs
Hi, I would like to know if the execution plans of stored procs also get migrated when we do migration to 2005 from 2000 using attachdetach method or we will need to re-run the stored procs? The thing is when I am running the Stored procs in 2005, its performing really slow in first run. Any help in his regard is highly appreciated. Thanks, Ritesh
View Replies !
Email Confirmation Steps After Registration
Hi. I have set up my confirmation system to work as thus: 1) user registers 2) registration goes into a temp table with a code 3) user gets a MD5 code in his inbox 4) user clicks back 5) click-back page moves registration data from TEMP table to USER table and sends the user to the signin page. 6) ... Now, my question is - how do I handle this final step in account confirmation? Should the first signin act as a final confirmation of the users account? This makes sense. Should the data in the USER table self-delete after a day if there has been no first sign-in? Should I have a column in the USER table to show if the first login has happened? How should I do this? I am sure I could mess around with this but it would be great to get feedback from somebody that has done this multiple times and has a sense of what the best practice is (based on large volume examples). Your feedback is much apprecaited. Thanks.
View Replies !
Confirmation On Script Task Behavior
Hello, I am looking for some confirmation on a behavior of the SSIS Script Task. I have a custom script task that takes an input file, and archives it after it has been processed into the database. When I run this package in the Visual Studio GUI, if the destination drive is full, it throws an exception telling me that there is not enough disk space. So, my questions are: 1) If this happens when the package is running through the command line, would this exception still be thrown? (I am thinking it will be) 2) Also, Do I need to explicitly fail the script task in the event handler, in order to ensure this .Net exception being thrown will cause the component to fail. (I am fairly certain I do, since this is what I had to do inside of the Visual Studio GUI, but does anyone know if this same behavior would occur when running from the command line?) Thanks, Chris
View Replies !
Compilation Error On Store Procedure
Hi all,Here is my error: Server: Msg 245, Level 16, State 1, Procedure NewAcctTypeSP, Line 10Syntax error converting the varchar value 'The account type is already exist' to a column of data type int.Here is my procedure:ALTER PROC NewAcctTypeSP(@acctType VARCHAR(20), @message VARCHAR (40) OUT)ASBEGIN --checks if the new account type is already exist IF EXISTS (SELECT * FROM AcctTypeCatalog WHERE acctType = @acctType) BEGIN SET @message = 'The account type is already exist' RETURN @message END BEGIN TRANSACTION INSERT INTO AcctTypeCatalog (acctType) VALUES (@acctType) --if there is an error on the insertion, rolls back the transaction; otherwise, commits the transaction IF @@error <> 0 OR @@rowcount <> 1 BEGIN ROLLBACK TRANSACTION SET @message = 'Insertion failure on AcctTypeCatalog table.' RETURN @message END ELSE BEGIN COMMIT TRANSACTION END RETURN @@ROWCOUNTENDGO --execute the procedureDECLARE @message VARCHAR (40);EXEC NewAcctTypeSP 'CDs', @message;I am not quite sure where I got a type converting error in my code and anyone can help me solve it???(p.s. I want to return the @message value to my .aspx page)Thanks.
View Replies !
C++ Ole DB Stack Overflow During Sql Server Compilation
hi,when i execute :CCommand<CManualAccessor, CBulkRowset, CNoMultipleResults> rs;rs.SetRows(100);HRESULT code_resultat = rs.Open(session, requete, &propset, NULL,DBGUID_DBSQL, FALSE);with a requete with length = 13000, it works perfectlybut when my requete length is 200000 (example : SELECT * FROM myTABLEWHERE id_table IN("lot of number : more then 30000 number"))i have code_resultat = DB_E_ERRORSINCOMMAND (= 0x80040e14)and when i explore the IErrorInfo message, i have :minor = 565 and the message issource :Microsoft OLE DB Provider for SQL Serverserveur has made a stack overflow during compilation...Is there a solution to extract to data ?in a fast way ...thanks in advance ...Mike
View Replies !
Function Returning Error During Compilation.....
Hi , I am creating a function which is going to return a table. The Code ofr the function is as follows... =============================== Create function udf_qcard (@cg1 varchar(25)) returns @rec_card table (t_cusip varchar(10),t_data varchar(70)) AS begin declare @t1_sys char(10),@t1_all varchar(11) declare @temp_qcard table (tdata varchar(11) collate SQL_Latin1_General_CP1_CS_AS) if (substring(@cg1,1,2)='Q$') set @cg1 = (select substring(@cg1,3,len(@cg1)) where substring(@cg1,1,2)='Q$') DECLARE c1 SCROLL CURSOR FOR select groups_system, substring(groups_alldata,3,10) from tbl_groups where groups_system = @cg1 and groups_alldata like 'Q$%' and groups_seq>=1 FOR READ ONLY insert into @temp_qcard values(@cg1) OPEN C1 FETCH NEXT FROM c1 INTO @t1_sys,@t1_all WHILE @@FETCH_STATUS = 0 BEGIN insert into @temp_qcard values(@t1_all) declare @t2_sys char(10),@t2_all varchar(10) DECLARE c2 SCROLL CURSOR FOR select groups_system, substring(groups_alldata,3,10) from tbl_groups where groups_system = @t1_all and groups_alldata like 'Q$%' and groups_seq>=1 FOR READ ONLY begin OPEN C2 FETCH NEXT FROM c2 INTO @t2_sys,@t2_all WHILE @@FETCH_STATUS = 0 BEGIN insert into @temp_qcard values(@t2_all) declare @t3_sys char(10),@t3_all varchar(10) DECLARE c3 SCROLL CURSOR FOR select groups_system, substring(groups_alldata,3,10) from tbl_groups where groups_system = @t2_all and groups_alldata like 'Q$%' and groups_seq>=1 FOR READ ONLY begin OPEN C3 FETCH NEXT FROM c3 INTO @t3_sys,@t3_all WHILE @@FETCH_STATUS = 0 BEGIN insert into @temp_qcard values(@t3_all) FETCH NEXT FROM c3 INTO @t3_sys,@t3_all end end close c3 deallocate c3 FETCH NEXT FROM c2 INTO @t2_sys,@t2_all end end close c2 DEALLOCATE c2 FETCH NEXT FROM c1 INTO @t1_sys,@t1_all END CLOSE c1 DEALLOCATE c1 Insert @rec_card select groups_q+groups_cusip,groups_data from tbl_groups where groups_system in (select tdata from @temp_qcard) and groups_seq>=1 and groups_alldata not like 'Q$%' order by groups_alldata RETURN END ========================== While compiling this I am getting the Below error .... ================== Server: Msg 1049, Level 15, State 1, Procedure udf_qcard, Line 10 Mixing old and new syntax to specify cursor options is not allowed. Server: Msg 1049, Level 15, State 1, Procedure udf_qcard, Line 23 Mixing old and new syntax to specify cursor options is not allowed. Server: Msg 1049, Level 15, State 1, Procedure udf_qcard, Line 35 Mixing old and new syntax to specify cursor options is not allowed. ================= Can Anyone please help me how to resolve this issue... Thanks with Regards. -Mohit.
View Replies !
SSIS Package Compilation And Execution
I am wondering something, once we've created a job that executes a package at a given time interval, does that package get recompiled each time the job spins up and executes the package? Or is the package compiled once and then that compiled code is executed each run after the first run? What I'm seein is this; I have a package that reads data from flat text files and then dumps that data into the database. The package will take 3 minutes to execute when executing on a single file, but when it's looping through ~50 files, it will take ~30 minutes to execute, that is less than a minute per file. Why is this? Hopefully I'm just forgetting something and not setting a checkbox or radio button somewhere. The job is set up as an SSIS job, not as a command line job. Thanks in advance for any help you can give me. Wayne E. Pfeffer Sr. Systems Analyst Hutchinson Technolgy Inc.
View Replies !
Newbie With An Easy Compilation Error Question.
I've been looking over this and can't see anything wrong. Can anyone shed some light on this for me? ------------------ Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0117: 'System.Data.SqlClient.SqlConnection' does not contain a definition for 'ExecuteReader' Source Error: Line 16: SqlCommand myComm = new SqlCommand("SELECT users, password FROM users WHERE username='" + username + "' AND password='" + password + "'", myConn); Line 17: myConn.Open(); Line 18: SqlDataReader myReader = myConn.ExecuteReader(); Line 19: do Line 20: { Source File: D:Inetpubhoteladvisor estLogin.aspx Line: 18 void Login(string username, string password) { SqlConnection myConn = new SqlConnection ("server = client1; uid = dbadmin; pwd = dbadmin; database = hotels"); SqlCommand myComm = new SqlCommand("SELECT users, password FROM users WHERE username='" + username + "' AND password='" + password + "'", myConn); myConn.Open(); SqlDataReader myReader = myConn.ExecuteReader(); do { while (reader.Read()) { if (username == myReader.GetString(1) && password == myReader.GetString(2)) { messages.Text = "Your login was successful!"; } else { messages.Text = " Your login was unsuccessful!"; } } } while (reader.NextResult()); myReader.Close(); myConn.Close(); } void Submit_Click(Object sender, EventArgs e) { Login(username.Text, password.Text); } Edit by moderator - NetProfit: Added < code>< /code> tags.
View Replies !
Ignore Compilation Errors For Creation Of Stored Procedures
I have an application that is moving from an home made full text search engine to using the full text indexing engine of SQL 2005. I have a stored procedure that I want to behave as: check documents table to determine whether a full text index for SQL's full text engine has been created. If it has not, query the documentText table (which is the table for my in-house full text search) If it has, use the full text indexing engine My problem is that compilation of the TSQL to create the stored procedure fails when the full text index has not already been created with the followign error: Msg 7601, Level 16, State 2, Procedure My_FullTextSearch, Line 0 Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Documents' because it is not full-text indexed. In my test lab, I tried: 1. creating the full text index 2. creating the stored procedure 3. deleting the ful text index which gets me to the desired end result of having a stored procedure that can determine whether or not the full text index has been created yet (the procedure works in this state). But I creating this index as part of this stored procedure creation in production is not an option. My question - Can I somehow tell SQL to ignore the compilation errors it encounters while creating this stored procedure? If not, is there some other way to create this "smart" stored procedure? Here's a code snippet stripped down to the bare minimum to generate the error: CREATE PROCEDURE [My_FullTextSearch] @Term VarChar(1000) AS BEGIN SET NOCOUNT ON; IF NOT OBJECTPROPERTY(OBJECT_ID('Documents'), 'TableHasActiveFulltextIndex')=1 BEGIN Select [DocumentID] from [DocumentText] where [Term] like '%' + LTRIM(@Term) + '%' END ELSE BEGIN Select [key] from FREETEXTTABLE(Documents, Contents, @Term) END END
View Replies !
Request For Confirmation Of SQL 2005 Optimiser Bug With Derived Table And Convert()
I have discovered what looks like a bug in the optimiser. I've posted it at https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=288243 but I wonder if any of you with SQL 2005 RTM, 2005 SP1 or 2008 CTP could confirm when this was introduced and whether it is still an issue? Code Snippet -- Bug report -- 2007/07/19 -- Alasdair Cunningham-Smith -- alasdair at acs-solutions dot co dot uk set nocount on go -- example date in in British date format set dateformat dmy go use tempdb go create table foo( bar varchar( 30 ) not null ) go insert into foo( bar ) values ( 'fishy' ) insert into foo( bar ) values ( '19/07/2007' ) go -- this works fine in all versions - only valid dates are passed to the convert function select convert( smalldatetime, bar, 103 ) as bardate from foo where bar like '__/__/____' go -- this works on SQL 2000, but fails on SQL 2005 SP2 (I've not tried other SPs of SQL 2005): -- Msg 295, Level 16, State 3, Line 2 -- Conversion failed when converting character string to smalldatetime data type. -- -- I believe the query is rewritten as if the derived table query contained -- "and convert( smalldatetime, bar, 103 ) < getdate()" -- which would expose the convert to the invalid data select * from ( select convert( smalldatetime, bar, 103 ) as bardate from foo where bar like '__/__/____' ) as derived where bardate < getdate() go -- Workaround: -- Use a case statement to protect the convert operator from the invalid data select * from ( select case when bar like '__/__/____' then convert( smalldatetime, bar, 103 ) else null end as bardate from foo where bar like '__/__/____' ) as derived where bardate < getdate() go drop table foo go The workaround I discovered is simple but ugly. I invite your comments... alasdair.
View Replies !
Stored Procedure Compilation Question: Doing Disparate Things In Aproc
To minimize the very large number of stored procedures typicallyassociated with an application, I have gotten in the habit ofcombining a select, insert, update, and delete all in one procedure,and passing an argument to indicate which to use. (I use defaultvalues for all input params to avoid having to declare them forselects and deletes.) So I'll have just one PersonAdmin proc insteadof PersonGet, PersonInsert, PersonUpdate, and PersonDelete procsWhile this is nice for housekeeping, I wonder what the compiler doeswith such an architecture,and I fear the worst. The select returns arecordset; the others don't.Is this a bad idea?If it is, I really wish SQL would permit some sort of user folderstructure in the proc list.
View Replies !
SqlDataSource, DataView, CType Function && Page_Load-Compilation ErrorBC30451: Name 'SqlDataSource3' Is Not Declared.
Hi all, In my VWD 2005 Express, I created a website "AverageTCE" that had Default.aspx, Default.aspx.vb and App_Code (see the attached code) for configurating a direct SqlDataSource connection to the dbo.Table "LabData" of my SQL Server 2005 Express "SQLEXPRESS" via SqlDataSource, DataView, CType Function and the Page_Load procedure. I executed the website "AverageTCE" and I got Compilation ErrorBC30451: Name 'SqlDataSource3' is not declared: Server Error in '/AverageTCE' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30451: Name 'SqlDataSource3' is not declared.Source Error: Line 8: <DataObjectMethod(DataObjectMethodType.Select)> _ Line 9: Public Shared Function SelectedConcentration() As ConcDB Line 10: Dim dv As DataView = CType(SqlDataSource3.Select(DataSourceSelectArguments.Empty), DataView) Line 11: dvConcDB.RowFilter = "Concentration = '" & ddlLabData.SelectedValue & "'" Line 12: Source File: C:Documents and Settingse1enxshcMy DocumentsVisual Studio 2005WebSitesAverageTCEApp_CodeConcDB.vb Line: 10 //////////--Default.aspx--////////////////////////// <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>SQL DataSource</title> </head> <body> <form id="form1" runat="server"> <div> Average TCE<br /> <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="SampleID" DataValueField="SampleID"> </asp:DropDownList><asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ChemDatabaseConnectionString2 %>" SelectCommand="SELECT [SampleID] FROM [LabData]"></asp:SqlDataSource> <br /> <br /> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="SampleID" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="SampleID" HeaderText="SampleID" ReadOnly="True" SortExpression="SampleID" /> <asp:BoundField DataField="SampleName" HeaderText="SampleName" SortExpression="SampleName" /> <asp:BoundField DataField="AnalyteName" HeaderText="AnalyteName" SortExpression="AnalyteName" /> <asp:BoundField DataField="Concentration" HeaderText="Concentration" SortExpression="Concentration" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="ddlLabData" runat="server" ConnectionString="<%$ ConnectionStrings:ChemDatabaseConnectionString %>" SelectCommand="SELECT * FROM [LabData] WHERE ([SampleID] = @SampleID)"> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1" DefaultValue="3" Name="SampleID" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> <br /> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ChemDatabaseConnectionString3 %>" SelectCommand="SELECT * FROM [LabData]"></asp:SqlDataSource> <br /> <br /> LabData-Analyte: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br /> <br /> LabData-Conc: <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br /> <br /> Average values: <asp:Label ID="Label1" runat="server" Text="lblAverageValue"></asp:Label><br /> <br /> <br /> <br /> </div> </form> </body> </html> ///////////--Default.aspx.vb--//////////////////////////////// Partial Class _Default Inherits System.Web.UI.Page End Class ////////////////--App_Code/ConcDB.vb--////////////////////// Imports Microsoft.VisualBasic Imports System.ComponentModel Imports System.Data Imports System.Data.SqlClient Imports System.Data.SqlTypes <DataObject(True)> Public Class ConcDB <DataObjectMethod(DataObjectMethodType.Select)> _ Public Shared Function SelectedConcentration() As ConcDB Dim dv As DataView = CType(SqlDataSource3.Select(DataSourceSelectArguments.Empty), DataView) dvConcDB.RowFilter = "Concentration = '" & ddlLabData.SelectedValue & "'" Dim dvRow As DataRowView = dvConcDB(0) Dim ConcDB As New ConcDB ConcDB.SelectedConcentration = CDec(0)("Concentration") Return ConcDB End Function Call AverageValue (Conc1) Public Shared Function AverageValue(ByVal Conc1 As Decimal) Dim AverageConc As Decimal AverageConc = (Conc1 + 22.0) / 2 Return AverageConc End Function End Class ************************************************************** I have 2 questions to ask: 1) How can I fix this Compilation Error BC30451: Name 'SqlDataSource3' is not declared? 2) I just read MSDN Visual Studio 2005 Technical Article "Data Access in ASP.NET 2.0" and I saw the following thing: Types of Data Sources: SqlDataSouirce: The configuration of a SqlDataSoure is more complex then that of the AccessDataSource, and is intended for enterprise applications that require the features provided by a true database management system (DBMS). I am using the website application in VWD 2005 Express to do the task of extracting data values from the Tables of SQL Server 2005 Express via .NET Framwork, ASP.NET 2.0 and VB 2005 programming. Can VWD 2005 Express be configured to SQL Server 2005 Express (SQLEXPESS) for the SqlDataSource connection and do the data-extraction task via DataView, CType Function and the Page-Load procedure? Please help, respond and answer the above-mentiopned 2 questions. Many Thanks, Scott Chang
View Replies !
Can't Find Or Load Message DLL. Message DLL Must Be In Path Or In Current Directory.
In my SQL Server, I see the below message in the Application Event Viewer "18265 : Log backed up: Database: HSD, creation date(time): 2007/01/06(05:05:05), first LSN: 1439:495055:1, last LSN: 1439:496675:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'D:MSSQLBACKUPHSDHSD_tlog_200707141300.TRN'})." When I save the application event viewer and open it in another server, I do not see the above message, instead I get the following message: " Can't find or load message DLL. Message DLL must be in path or in current directory." Any thoughts to overcome this problem is appreciated. Thanks Santhosh
View Replies !
Message Type And Message Body..............
Hello, I am having trouble specifying a message body that is valid. I mean for the client to send. If I leave it as null then everything is ok but if I create a memorystream and add a line of text it reports back it did not pass validation. I do not understand this and am not sure what to do. I need to send a message based on a code and text but do not know the format of the body that is allowed. The code I am refering to comes out of HelloWord_CLR because that is what I am formating my sample after. I call it the same way it calls the return message done in ServiceProc. I need to know the message format including body since this does not seem to work. A sample of the call is bellow. // Create an empty request message string Msg = "Hello"; MemoryStream body = new MemoryStream(Encoding.ASCII.GetBytes(Msg)); Message request = new Message("Request", body); Thanks, Scott Allison...
View Replies !
No Message
I have Store Procedure that gets all the processes that user are running. But I don't want to display system messages on the result set. How do I do this. Thank You, john
View Replies !
No Message
I have Store Procedure that gets all the processes that user are running. But I don't want to display system messages on the result set. How do I do this. Thank You, john
View Replies !
No Message
I have Store Procedure that gets all the processes that user are running. But I don't want to display system messages on the result set. How do I do this. Thank You, john
View Replies !
Where Does This Message Come From And Why?
We are running transactional replication on sqlserver 2000 and I see the following message: "The initial snapshot for article reason_type is not yet available" Followed 10 minutes later by a "timeout expired" event (we see lots of these). I see no reason for a snapshot to even be running at 3:04 AM but then, it apparently was so what can I say. The Snapshot agent history does not show any entries for the last year so that is a bit of a mystery. The table in question seems identical at both the publisher and subscriber (including content). Any ideas why this message would appear? It appears that a snapshot for this article was somehow involved but I thought a snapshot was only created by specific request. Thanks.
View Replies !
Where Is The Message ?
I sent a message from Server A to B. I didn't end the conversation. The message is stuck in sys.tranmission_queue with no error message (empty) . the initiatorQueue is empty (no records). why doesn't the message get sent ?
View Replies !
How Do I Know Where My Message Come From
I have a service broker service and there are multiple clients that can put messages in the queue of that service. How do I check which message comes from which client? There is no field in the queue like message_senderId or something like that.
View Replies !
Message Box In Rdl
hi everybody i m using dynamic connection in rdl file firstly i m showing username and pwd . after this user name and pwd i make a connection string for my report. when i m entering invalid pwd, than report generate an error. and stop. is there any way by which i can trace error and flash a message box to user about his invalid user name or pwd. thanks
View Replies !
Message Box
Hi I have basic knowledge of SQL Server and Expert in MS Access Know I want to change my Access Database into Database. Now what i required is when I create any Procedure then we use a condition helping keyword 'Where' No what I required is when I execute any procedure using where clause It must open a Input Box where I put a condition For Example when I create a procedure like this create Procedure prc_Demo ( a int, as Select * from employee where emp_id = 'a' ) Something like that So I want when I execute this then there must be open a box where I type emp_id then it show matching the result How can it is possible Thanks Ashish You Have to Loss Many Times to Win Single Time
View Replies !
Message
Hi Can anybody guide -- how to send the message to the user connected to SQL server 2005 on lan thanks
View Replies !
Message In SQL Log
Has anyone encounterd this message in the sql log: ----- BACKUP LOG WITH TRUNCATE_ONLY or WITH NO_LOG is deprecated. The simple recovery model should be used to automatically truncate the transaction log. ----- DB's are in simple recovery mode and only a daily backup is being done on DB's. It almost seems that SQL is doing something internally. thanks
View Replies !
Error Message
Hi,I am trying to write some C# ASP.NET 2.0 code. I have created a web form to send data to my sql server 2005 database. When I compile the application and insert data then click on the submit button I get this error "A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll" I have been trying to solve this for a few days now with no luck, so any help would be appreciated. I'll post below the source code of the web form (addOrder.aspx). It might be worth mentioning that I have created another web form in the same project called addCustomer.aspx. Like addOrder.aspx it is a web form, however it successfully inserts data in the database. 1 <%@ Page Language="C#" MasterPageFile="~/Default.master" Title="Add Order Page" %> 2 <%@ import namespace="System.Data.SqlClient" %> 3 <%@ Import Namespace="System.Data" %> 4 <%@ Import Namespace="System.Web" %> 5 <%@ Import Namespace="System.Configuration"%> 6 <%@ Import Namespace="System.Globalization"%> 7 8 <script runat="server"> 9 10 protected void Page_Load(object sender, EventArgs e) 11 { 12 13 } 14 15 protected void sumbitButton_Click(object sender, EventArgs e) 16 { 17 SqlConnection conn; 18 SqlCommand comm; 19 string connectionString = 20 ConfigurationManager.ConnectionStrings[ 21 "ShippingSystemConnectionString1"].ConnectionString; 22 conn = new SqlConnection(connectionString); 23 comm = new SqlCommand( 24 "INSERT INTO Order(CustomerID, " + 25 "NumberofItems, DescriptionsofItems, SafeItems) " + 26 "VALUES (@CustomerID, " + 27 "@NumberofItems, @DescriptionsofItems, @SafeItems)", conn); 28 comm.Parameters.Add("@CustomerID", System.Data.SqlDbType.Int); 29 comm.Parameters["@CustomerID"].Value = int.Parse(DropDownList1.SelectedValue); 30 comm.Parameters.Add("@NumberofItems", System.Data.SqlDbType.Int); 31 comm.Parameters["@NumberofItems"].Value = numofitemstxt.Text; 32 comm.Parameters.Add("@DescriptionsofItems", System.Data.SqlDbType.VarChar); 33 comm.Parameters["@DescriptionsofITems"].Value = descofitemstxt.Text; 34 comm.Parameters.Add("@SafeItems", System.Data.SqlDbType.VarChar); 35 comm.Parameters["@SafeItems"].Value = safetxt.Text; 36 try 37 { 38 conn.Open(); 39 comm.ExecuteNonQuery(); 40 Response.Redirect("Success.aspx"); 41 } 42 catch 43 { 44 } 45 finally 46 { 47 conn.Close(); 48 } 49 } 50 51 52 53 protected void CustomerIDList_SelectedIndexChanged(object sender, EventArgs e) 54 { 55 56 } 57 </script> 58 59 <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 60 <table style="position: static"> 61 <tr> 62 <td style="width: 169px"> 63 Customer ID:</td> 64 <td style="width: 100px"> 65 <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" 66 DataTextField="CustomerID" DataValueField="CustomerID" Style="position: static"> 67 </asp:DropDownList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ShippingSystemConnectionString1 %>" 68 SelectCommand="SELECT [CustomerID] FROM [Customer]"></asp:SqlDataSource> 69 </td> 70 <td style="width: 178px"> 71 </td> 72 </tr> 73 <tr> 74 <td style="width: 169px"> 75 Number of Items:</td> 76 <td style="width: 100px"> 77 <asp:TextBox ID="numofitemstxt" runat="server" Style="position: static"></asp:TextBox></td> 78 <td style="width: 178px"> 79 <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="numofitemstxt" 80 ErrorMessage="Number of Items Required" Style="position: static"></asp:RequiredFieldValidator></td> 81 </tr> 82 <tr> 83 <td style="width: 169px"> 84 Descriptions of Items:</td> 85 <td style="width: 100px"> 86 <asp:TextBox ID="descofitemstxt" runat="server" Style="position: static"></asp:TextBox></td> 87 <td style="width: 178px"> 88 <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="descofitemstxt" 89 ErrorMessage="Description Required" Style="position: static"></asp:RequiredFieldValidator></td> 90 </tr> 91 <tr> 92 <td style="width: 169px"> 93 Are Items safe:</td> 94 <td style="width: 100px"> 95 <asp:TextBox ID="safetxt" runat="server" Style="position: static"></asp:TextBox></td> 96 <td style="width: 178px"> 97 <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="safetxt" 98 ErrorMessage="Are Items Safe?" Style="position: static"></asp:RequiredFieldValidator></td> 99 </tr> 100 <tr> 101 <td style="width: 169px"> 102 <asp:ValidationSummary ID="ValidationSummary1" runat="server" Style="position: static" /> 103 </td> 104 <td style="width: 100px"> 105 <asp:Button ID="sumbitButton" runat="server" OnClick="sumbitButton_Click" Style="position: static" 106 Text="Submit" /></td> 107 <td style="width: 178px"> 108 </td> 109 </tr> 110 </table> 111 </asp:Content> 112 113 My order table in SQL server 2005 (express) looks like this:
View Replies !
Error Message??
Hi,I have an error message: Exception Details: System.Data.SqlClient.SqlException: Conversion failed when converting the varchar value '@qty' to data type int.It doesnt say which line of code it is reffering to however..Could someone help me? The parameter for @qty is Textbox1.Text - maybe I could make the text box int only or something? My code is: private bool ExecuteUpdate(int quantity){ SqlConnection con = new SqlConnection(); con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True"; con.Open(); SqlCommand command = new SqlCommand(); command.Connection = con; TextBox TextBox1 = (TextBox)FormView1.FindControl("TextBox1"); Label labname = (Label)FormView1.FindControl("Label3"); Label labid = (Label)FormView1.FindControl("Label13"); command.CommandText = "UPDATE Items SET Quantityavailable = Quantityavailable - @qty WHERE productID=@productID"; command.Parameters.Add("@qty", TextBox1.Text); command.Parameters.Add("@productID", labid.Text); command.ExecuteNonQuery(); con.Close(); return true;} private bool ExecuteInsert(String quantity) { SqlConnection con = new SqlConnection(); con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True"; con.Open(); SqlCommand command = new SqlCommand(); command.Connection = con; TextBox TextBox1 = (TextBox)FormView1.FindControl("TextBox1"); Label labname = (Label)FormView1.FindControl("Label3"); Label labid = (Label)FormView1.FindControl("Label13"); command.CommandText = "INSERT INTO Transactions (Usersname,Itemid,itemname,Date,Qty) VALUES ('@User','@productID','@Itemsname',@date,'@qty')"; command.Parameters.Add("@User", System.Web.HttpContext.Current.User.Identity.Name); command.Parameters.Add("@Itemsname", labname.Text); command.Parameters.Add("@productID", labid.Text); command.Parameters.Add("@qty", TextBox1.Text); command.Parameters.Add("@date", DateTime.Now.ToString()); command.ExecuteNonQuery(); con.Close(); return true; }protected void Button2_Click(object sender, EventArgs e){ TextBox TextBox1 = FormView1.FindControl("TextBox1") as TextBox; ExecuteUpdate(Int32.Parse(TextBox1.Text) );}protected void Button2_Command(object sender, CommandEventArgs e) { if (e.CommandName == "Update") { TextBox TextBox1 = FormView1.FindControl("TextBox1") as TextBox; ExecuteInsert(TextBox1.Text); } } Thanks to anyone who can help!!!Jon
View Replies !
SQL Error Message
I have a SQL Express database on our server that is used for one of our websites when the website tries to write to the database I get the following error: - An attempt to attach an auto-named database for file D:lahwebsitesGiants North Walesapp_datadatabase.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. This error is very frustrating and I really can't find a way around it. I have done the following: - Deleted the SQL Server Express folders under user preferences
View Replies !
SQL Error Message Help
I am trying to set a text field as the primary key for a SQL SERVER Express 2005 Database in Visual Studio. I used the following Command:ALTER TABLE Tablename ADD PRIMARY KEY (fieldname);where you substitute table name and fieldname for the appropriate fields. The error message I am getting is:SQL Execution Error.Executed SQL statement: ALTER TABLE Lake ADD PRIMARY KEY(wbic);Error Source .Net SqlClient Data ProviderError Message: Column 'wbic' in table Lake is of a type that is invalid for use as a primary key column or index.Could not create constraint. See previous errors.How can I fix this so any type of field can be a primary key?
View Replies !
Help With Error Message
I'm trying to connect to an SQL database on my server and I keep getting an error message that I can't seem to find out any information about. I have tried looking on Google and there only seems to be one post which doesn't offer me any help. Has anyone else come across this error? SSE Instance re-direction is not supported for non-local user instances. 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.NotSupportedException: SSE Instance re-direction is not supported for non-local user instances. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [NotSupportedException: SSE Instance re-direction is not supported for non-local user instances.] System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +577 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1837 System.Web.UI.WebControls.BaseDataList.GetData() +53 System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) +284 System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +56 System.Web.UI.WebControls.BaseDataList.DataBind() +72 System.Web.UI.WebControls.BaseDataList.EnsureDataBound() +55 System.Web.UI.WebControls.BaseDataList.CreateChildControls() +63 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +41 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1787 Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44
View Replies !
Error Message
I finally installed MSDE and have the icon in my tray at the bottom of the screen. When I try to connect to a database using the wizard in the web matrix program I get this message: Unable to connect SQL Server does not exist of access denied Connection Open (Connect ()) What might be wrong?? Thanks for your help I'll get it soon (I hope) Del Dobbs
View Replies !
SQL Error Message
HI FRIENDS WHEN I TRY TO RUN A PROGRAM WHICH BINDS A DATAGRID CONTROL TO A SQL SERVER TABLE I GET A ERROR MESSAGE LIKE [SQL EXECEPTION LOGIN FAILED FOR HOMECOMPUTER/ASPNET] . IF U KNOW WHAT MIGHT COZ THE PROBLEM PLEASE TELL ME. IAM RUNNING THE MICROSOFT SQL SERVER FORM MY HOME COMPUTER I.E (LOCAL) . IS THERE SOME SETTINGS THAT I NEED TO DO BEFORE RUNNING A PAGE WHICH CONNECTS TO THE SQL SERVER.
View Replies !
|