Using Web Matrix I made and tested a query using the Sql wizard acessing a SQL server table and it worked fine. Web Matrix created the following connection string, in the function to create the query : "server='(local)'; trusted_connection=true; database='AVAL_360'" But when the function created to execute the same query,my application then the following error showed up. Login failed for user What is the matter ? Can someone help me ? Thanks in advance
Hi, I'm using ComponentArt's Callback grids with Manual Paging.
The CA example grid uses Access:(http://www.componentart.com/webui/demos/demos_control-specific/grid/programming/manual_paging/WebForm1.aspx)
That SQL syntax produced is invalid in SQL Server 2005.
Example: "SELECT TOP " & Grid1.PageSize & " * FROM (SELECT TOP " & ((Grid1.CurrentPageIndex + 1) * Grid1.PageSize) & " * FROM Posts ORDER BY " & sSortColumn & " " & sSortOrderRev & ", " & sKeyColumn & " " & sSortOrderRev & ") ORDER BY " & sSortColumn & " " & sSortOrder & ", " & sKeyColumn & " " & sSortOrder
So...This is what I have (simplified), and it appears return incorrect rows on the last few pages: SELECT top 15 * FROM Posts where & sFilterString & " and Postid in (SELECT TOP " & ((Grid1.CurrentPageIndex + 1) * Grid1.PageSize) & " Postid FROM Posts where " & sFilterString & " ORDER BY " & sSortColumn & " " & sSortOrder & ") " & " ORDER BY " & sSortColumn & " " & sSortOrderRev
What other approaches has anyone used besides the "ID in (...)"?The examples I have included show the available variables: sort asc and desc, current page, number of rows on a page, etc.
Hello, We are using SQl as the DB for our application. Now we lost direct acess to the DB, but we can acess through the application. How we will get the direct acess back? The network side is ok. We don't know how it happened. can anybody help me to resolve this?
Is it possible to access a file (for example, to write in a text file)with transact-sql?.I've create a stored procedure and I'd like to write in a log filesome traces depends on the result of the statements executed in thisstored procedure.Thanks
I am using Vista Business with Visual Web Developer and Sql Server Express 2005. I want to be able to access the data from two tables in a query. Both tables are attached to the application. To refer to the two databases I have used the following DATABASE.OWNER.TABLE (specifically TaskMgr.dbo.TaskTable) For both databases I get the error "Invalid object name" What am I missing? Thanks
hi i was reading book about asp.net and i found example for a dataacess class but i didn't understand this part
Private m_FieldData As New NameObjectCollection Private _m_ConnectionString As String Private m_dbConnection As SqlConnection Private Sub AddParameters( _ ByVal objCommand As SqlCommand, _ ByVal objValues() As Object)
Dim objValue As Object Dim I As Integer Dim objParameter As SqlParameter
I = 0 For Each objParameter In objCommand.Parameters If objParameter.Direction = ParameterDirection.Input _ Or objParameter.Direction = _ ParameterDirection.InputOutput Then
objValue = objValues(I) objParameter.Value = objValue I = I + 1 End If Next End Sub
Private Sub AddFieldParameters _ (ByVal objCommand As SqlCommand)
For Each objParameter In objCommand.Parameters objParameter.Value = _ _FieldData.Item(objParameter.ParameterName. _ Substring(1)) Next End Sub Public Function ExecDataReader _ (ByVal strStoredProc As String, _ ByVal ParamArray objValues() As Object) _ As SqlDataReader
Dim objCommand As SqlCommand Dim objReader As SqlDataReader
Try objCommand.Connection.Open() If (objValues.Length = 0) Then AddFieldParameters(objCommand) Else AddParameters(objCommand, objValues) End If objReader = objCommand. _ ExecuteReader(CommandBehavior.CloseConnection) Catch ex As Exception If objCommand.Connection.State.Open Then objCommand.Connection.Close() End If End Try
Return objReader End Function can anybody help me what the author want to do
Hello,I am unable to access SQL Server 2005 (Express Edition) when i am creating wesites on localhost.But the same database can be accessed without any problem when websites are created on local file system.When creating the website on localhost and trying to access databse the following error is displayed: " Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed."Anyone plz help me out of this? Thanks.Ashu.
I currently have an issue trying to access my database in SQLexpress2005. Whenever i try to start the service it errors out. I looked at the error in event viewer and it says says "The log scan number passed out to log scan in database 'master' is not valid. This error my indicate data corruption or that the ldf does not match the mdf....."
How can i fix this problem seing as though i can not access studio manager to restore the db?
hi. i got a question regarding the permission on share folder. i wonder i am able to do this as below.. if on runtime, after i export the data to xmlfile and i want it to auto save into the SHARE Folder in sql server. can i do that ?
** after press a button, auto export data to xml file, then auto save the xml file to share folder.
We have a MS Access .adp app which is having some security problems. We have a windows global group which is a user - which is added to a role. The developers are having problems with unqualified sql statements trying to find user.table instead of dbo.table. It seems we are not able to specify a default schema for the global 'user' - the option is greyed out and a sql statement fails. MS says: Default Schemas
A default schema is used to resolve the names of securables that are referred to without their fully qualified names. In SQL Server 2000, name resolution first checks the schema owned by the calling database user, followed by the schema owned by dbo.
In SQL Server 2005, each user has a default schema. The default schema can be set and changed by using the DEFAULT_SCHEMA option of CREATE USER or ALTER USER. If DEFAULT_SCHEMA is left undefined, the database user will have dbo as its default schema.
Is the default truly undefined in a global group user? We are not totally locked in to the global group solution, but it does make admin easier for us.
Dear Experts,Ok, I hate to ask such a seemingly dumb question, but I'vealready spent far too much time on this. More that Iwould care to admit.In Sql server, how do I simply change a character into a number??????In Oracle, it is:select to_number(20.55)from dualTO_NUMBER(20.55)----------------20.55And we are on with our lives.In sql server, using the Northwinds database:SELECTr.regionid,STR(r.regionid,7,2) as a_string,CONVERT(numeric, STR(r.regionid,7,2)) as a_number,cast ( STR(r.regionid) as int ) as cast_to_numberFROM REGION R1 1.00112 2.00223 3.00334 4.0044SELECTr.regionid,STR(r.regionid,7,2) as a_string,CONVERT(numeric, STR(r.regionid,7,2) ) as a_number,cast (STR(r.regionid,7,2) as numeric ) as cast_to_numberFROM REGION R1 1.00112 2.00223 3.00334 4.0044Str converts from number to string in one motion.Isn't there a simple function in Sql Server to convertfrom string to number?What is the secret?Thanks
Hi, I have a SQL Server 2005 Database that I would like to export to SQL Server Express. How do I go about this? I've tried backing it up, creating a new (blank) SQL Server Express Database and trying to restore it, but get the following message: TITLE: Microsoft SQL Server Management Studio------------------------------ Restore failed for Server 'PRODSOL-LAPTOP1SQLEXPRESS'. (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476 ------------------------------ADDITIONAL INFORMATION: System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'ProdsolPGC' database. (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&LinkId=20476 Neither of the links provide any more information and I'm sure that I'm missing a step out. I've tried scripting the existing database and then running the script against the new database, but I can't get that to work either - these blooming newbies! Please help! Thanks very much. Regards Gary
Hi, Is there a tool that anyone here is aware of which converts SQL, stored procedures and such stuff from Oracle compatibility to SQL Server compatibility? I have some Oracle based SQL that I wud like to convert into T-sql instead of re writing the whole T-SQL.. Thanks,
Hello does anybody know how to convert an SQL Server file into a DBF or an Excel sheet? I need to do this programmitically with C# or python. Preferrably C#. Also, the converted file must be placed into a different folder. Thanks.
I have to downgrade a eCommerce database from Sql Server 2005 to Sql Server 2000 due to hosting server's support compatibility. Almost all features in the original (2005) version are available in 2000. Any recommendations as on an easy conversion? Thanks a lot. -Yubo
Sorry if this has been answered before. Could not find any answers. OS Vista Business, SQL Server 2005 Express. I have a CSV file which I imported to Access only 100 records with 8 fields. Then ran Tools >> Database Utilities >> Upsizing Wisard. The result was I exported the table field headers but not the data. Is there any method on how I can get the field headers and data into SQL Server Express?
Hello There, I would really appreciate if you can help me with this problem. I am currently using SQL Server 2005 Express for one of my web application. I have a .bak file (backup file) provided by my client which I want to use for testing purpose. Now I just want to know how can I use that backup file without installing SQL SERVER 2005 as one way to do this I know is to restore the database in SQL Server 2005 Enterprise Manager but I can't install SQL Server 2005. To my knowledge, SQL Server Express uses .mdf file for database but what I have is .BAK file.. I would be really glad to see your quick answers. Thank you for reading this far. Sincerely, Zulfiqar