I am trying to access the TableAdapter object from my WebPage Class on the Page_Load event , so I can modify the Command.CommandTimeout. Unfortunately, I cannot find a way to have access to the TableAdater object.
I created a new DataSet object using the wizard and had no probs, it's very straightforward. I created a GetProducts() method and also added a GetProductCount() method. I read somewhere that when the DataSet is saved, it will generate the TableAdapter classes and store them in the project nested under the DataSet object. This isn't happening, the files aren't there and yes I'm displaying all files. There *is* however the TableAdapter class but it's in not in the project, it's a temporary file w/ the following path:
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Fileswebsitef38f8b5500014aeSources_App_Codepw_products.xsd.72cecc2a.cs.
I saved the DataSet several times, compiled the entire solution and even closed the solution yet this temporary file isn't getting saved where it should be. Does anyone have any ideas abt this? I'm eager to start developing my DAL and def want to use these TableAdapter classes.
Just wondering if there are any online recources on writing SQL in a website? i have a database linked to an sql server, and from access etc. i can access it no problems.. just wanting to access it from a website.
I have a VB-class object running inside MS Transaction server. A function inside this class makes use of a temp table when a user does a web-query on my server which gets some data from SQL 6.5. Problem is, although the temptable is destroyed at the end of the function, my TempDB in SQL gets gradually fuller with each query that runs.
Why does this happen. I cannot release any of the tempdb space already in use, so eventually the tempdb gets completely full and SQL stops running.
I have created a report in reporting service 2005 and i have succesfully integrated the report in asp.net webpage. But i want to know whether it is possible to access the methods and properties of (report)rdl file in the asp.net webpage. If it is possible then please tell me how to implement it
Now I need to store the oMyClass object in the database for later use, at which point I would get it out of the database, cast it back to myClass, and be able to acess its properties, etc. My problem is that the classes that I am working with are not serializable, so I cannot store the objects as XML. Does anyone have an example of doing this programmatically with C# and ADO.NET. I am assuming that I would have to store it in a vabinary column, but how do I get it in there. Any help would be greatly appreciated. Thanks.
I copied my .mdf database from a file and pasted it into the visual studio project App_Data folder.I can see the tables and the columns etc when creating my TableAdapter, and create my sql query etc, but then when I hit the finish button, I get this error "an Unexpected Error has OccuredError Message: Access Denied". Anyone know why I can't create my TableAdapter?
Hi All, i have a table in MS Access with CandidateId and Image column. Image column is in OLE object format. i need to move this to SQL server 2005 with CandidateId column with integer and candidate Image column to Image datatype. its very udgent, i need any tool to move this to SQL server 2005 or i need a code to move this table from MS Access to SQL server 2005 in C#. please do the needfull ASAP. waiting for your reply with regards
for some reasons, I have to get access to the TaskHost during validation and execution. For example, I wanna know, if my task is within a container or not (parent is Sequence).
For the UI during design time, there is the TaskHost parameter. What about the execution time or during validation?
I have been using the .NET Enterprise Library for DataAccess patterns for some time now. I'm going back to a bunch of old legacy ADO code written in VB6/VB5 and would like to try and create the same "centralized" class that all of my code can instantiate and call to open database objects, call stored procedures, etc.
Does anyone know of any samples of papers which might describe this?
I'm trying to use the Data Access Application block, and am having some issues with configuration. I am using it in a class library, and it seems that with v 3 you need to configure the DAAB first, making changes to the configuration file. However, in a class library, I do not seem to have the web.config or app.config file to change. So where do I need to store the configuration settings? Thanks, Paul
Hai Guys, I have a doubt Regarding SqlDataReader i can able to create object to Sqlconnection,Sqlcomand etc... but i am unable to create object for SqlDataReader ? Logically i understand that SqldataReader a way of reading a forward-only stream of rows from a SQL Server database. This class cannot be inherited. sqlDatareader belongs to which class is it sealed or static class? can we create own class like SqldataReader ....... Reply Me ...... if any one know the answer..............
I am stuck with a SSIS package and I can€™t work out. Let me know what steps are the correct in order to solve this. At first I have just a Flat File Source and then Script Component, nothing else.
Error:
[Script Component [516]] Error: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.SqlClient.SqlConnection'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface. at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e) at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.AcquireConnections(Object transaction) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper90 wrapper, Object transaction)
Script Code (from Script Component):
' Microsoft SQL Server Integration Services user script component ' This is your new script component in Microsoft Visual Basic .NET ' ScriptMain is the entrypoint class for script components
Imports System Imports System.Data.SqlClient Imports System.Math Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Public Class ScriptMain Inherits UserComponent
Dim nDTS As IDTSConnectionManager90 Dim sqlConnecta As SqlConnection Dim sqlComm As SqlCommand Dim sqlParam As SqlParameter
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Dim valorColumna As String Dim valorColumna10 As Double
valorColumna = Row.Column9.Substring(1, 1)
If valorColumna = "N" Then valorColumna10 = -1 * CDbl(Row.Column10 / 100) Else valorColumna10 = CDbl(Row.Column10 / 100) End If
I am using the 3-tiered architecture design (presentation, business laws, and data acess layers). I am stuck on how to send the image the user selects in the upload file control to the BLL and then to the DAL because the DAL does all the inserts into the database. I would like to be able to check the file type in the BLL to make sure the file being uploaded is indeed a picture. Is there a way I can send the location of the file to the BLL, check the filetype, then upload the file and have the DAL insert the image into the database? I have seen examples where people use streams to upload the file directly from their presentation layer, but I would like to keep everything seperated in the three classes if possible. I also wasn't sure what variable type the image would be in the function in the BLL that receive the image from the PL. If there are any examples or tips anyone can give me that would be appreciated.
Hi, I need to audit any access to table (example table creditcards) profiler work fine if table creditcards referenced by select/ upadate/delete or procedure
but if I create view
create v_alex as select * from creditcards
profiler with all events would show only v_alex
Application modifing and number of views growing ...
Any way to trace accees to creditcards if it referenced by view ?
I would like to remove an index from my database, but I need to verifythat it is not being accessed before I do that.I tried running Profiler, but it doesn't seem to be giving me theinformation I need. I put in a filter for ObjectName, but it seems tobe ignoring it - i get several entries in the profile trace, but novalue in the ObjectName column.Is there an easy way to monitor for object access?Thanks so much!SQL Servef 2000 SP4(I also have 2005, SP2, if there's a better way to do this with 2005)
Hey there. I must write a stored procedure to update a table and want to make sure the ID used in both Acceptance and Production will have the necessary access. The ID will inherit it's access to the resource though a ROLE. Wondering if there are queries out there that can traverse for example, the roles/id's that have access to it... Thx!
Hi everyone. I am having difficulties with a cursor that I am trying to write. The purpose of the cursor is to loop through all tables in a selected Database and revoke "Select" access to that table for the indicated role (RoleToRevoke). I am getting the error on the @name variable within the REVOKE statement. I have placed a comment indicating where I am getting the error. Is there a way to have sql server interpret this @name variable within the REVOKE statement? Thanks for your help.
Code Snippet
USE [Database_Name];
Declare cursorExample Cursor for Select TABLE_NAME from information_schema.tables Where TABLE_TYPE='Base Table' and TABLE_SCHEMA='dbo'
Declare @name as varchar(255) Declare @ErrorSave as int Declare @ErrorCount as int
Open cursorExample
Fetch Next from cursorExample into @name
SET @ErrorSave = 0 SET @ErrorCount = 0
Begin Tran
While @@Fetch_Status=0
Begin
--Getting Error on Line below on @name REVOKE SELECT ON OBJECT::@name FROM RoletoRevoke;
IF (@@ERROR <> 0)
BEGIN
Print 'Error Revoking Access to Table: ' + CAST(@name AS varchar(75)) SELECT @ErrorCount = @ErrorCount + 1 END IF (@@ERROR = 0)
BEGIN
Print 'Successful Revoking Select Rights on Table: ' + CAST(@name AS varchar(75))
SELECT @ErrorSave = @ErrorSave + 1 END Fetch Next from cursorExample into @name
End
IF @ErrorCount = 0
BEGIN
COMMIT TRAN PRINT 'COMMITTED TRANSACTION' PRINT 'Total Tables Affected:' + CAST(@ErrorSave AS varchar(75)) END ELSE
Aaaaaarrgghh ! (that's better)I am trying to convert a field within my Oracle 9i Database that is oftype BLOB (but this BLOB may contain a combination of clobs/varchars orimages such as gif images, jpg images) to Microsoft SQL Server 2000using Microsoft DTS.On trying to perform this simple conversion I recieved the error "Needto run the object to perform the operation - Exception AccessViolation" from Microsoft DTS and my table that contains this BLOBfield is not converted across.After further investigation I implemented the fixes suggested by theMicrosoft Knowledge Base and "sqldts.com" but still no joy the errorkept occuring.I discovered my modifying the step in the DTS package that handled thistable conversion that contained the BLOB column that when I changed thedata type on my SQL Server target table to VARBINARY and modified thequery so that only the BLOBs that contained clobs/varchars were broughtacross that the error went away.I then proceeded to create another DTS package step that had a querythat only brought across the BLOB column that contained images such asgif images/jpeg images etc. and the error went away and the target typefor the SQL Server target table was set to IMAGE.As the data for this BLOB contains a combination of VARCHARS/CLOBS(concatanted) and also GIF IMAGES/JPEGS in the same source column withOracle 9i I require the same in my target table within SQL server asone column (and I should be able to do that with type IMAGE especiallyas it can store larger objects than VARBINARY but any source BLOBS thatcontain VARCHAR/CLOBs don't seem to want to be loaded as IMAGE theywill only load in to VARBINARY).However judging by my experiences above this doesn't seem to bepossible ?Can anyone help me out with this ?I am on Microsoft SQL Server 2000 Service Pack 4 with latest MDAC(2.8.1).Cheers,Gary
Trying to do a update/insert from SQL 2005 query to Access 2003 linked table.
In the Script Transformation I get this error.
Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.OleDb.OleDbConnection'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
Destinatoin Oledb connection is Native OLEDB Jet 4 to Access 2003 database.
Private sqlConn As OleDb.OleDbConnection
Private sqlCmd As OleDb.OleDbCommand
Private sqlParam As OleDb.OleDbParameter
Private connstring As String
Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
Hello,I am getting a SqlException with title "SqlException was unhandled by user code" and then it says "Invalid object name 'Access Table'.here is my code (this is from my login page:)<script runat="server">
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs)
Dim conn As SqlConnection Dim cmd As SqlCommand Dim cmdString As String = "SELECT [Password] FROM [AccessTable] WHERE" & _ " (([Username] = @Username) AND ([Password] = @Password))"
conn = New SqlConnection("Data Source=GDB03SQL;Initial Catalog=GDBRemitance;Persist Security Info=True;User ID=remitance;Password=remitance") cmd = New SqlCommand(cmdString, conn) cmd.Parameters.Add("@Username", SqlDbType.VarChar, 50) cmd.Parameters("@Username").Value = Me.Login1.UserName cmd.Parameters.Add("@Password", SqlDbType.VarChar, 50) cmd.Parameters("@Password").Value = Me.Login1.Password conn.Open() Dim myReader As SqlDataReader myReader = cmd.ExecuteReader(CommandBehavior.CloseConnection) If myReader.Read() Then FormsAuthentication.RedirectFromLoginPage(Me.Login1.UserName, False) Else Response.Write("Invalid credentials") End If myReader.Close()
End Sub </script> The error is comming from the myReader = cmd.Execute(CommandBehavior.CloseConnection)Thanks for any suggestions or ideas.
In my ssis 2012 package, I have a 'object' type variable with some table like records. I want to do some SQL operations like insert/update on the records in another table based on this 'Object' type variable records. Basically I want to use a MERGE statement with another physical table with the records in the 'Object' type variable.how to map/use the Object type variable in Execute sql task.I am not good in script task. How to utilize this Object variable in a Execute sql task? Â
husband built web site, hosted by 1and1, husband can't help right now and 1and 1 won't. I can't get the connection string correct and need some advise. This is the info 1and1 gave me for my db.
Database Name db212583089 User Name xxxxxxxxxxxxxxxx Password xxxxxxxxxxx Host Name mssql02.1and1.com Description jamm Status My bd is uploaded to their server and should connect with the global.asa page, this is what I have as a connection right now and it's not working <SCRIPT LANGUAGE=VBScript RUNAT=Server> Sub Application_OnStart '==FrontPage Generated - startspan== Dim FrontPage_UrlVars(1) '--Project Data Connection Application("Database1_ConnectionString" = "PROVIDER=SQLOLEDB;DATASOURCE=msssql02.1and1.com;DATABASE=db212583089;UID=dbo212583089;PWD=xDBXzNTt" Application("Database1_ConnectionTimeout") = 15 Application("Database1_CommandTimeout") = 30
this is the error i get on my website when i try to access my db.
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/JAMMDatabase.asp, line 131
This is the code on line 131, some before and some after: strProvider=Application("Database1_ConnectionString")
set objConn = server.createobject("ADODB.Connection") objConn.Open strProvider(line 131)
set cm = Server.CreateObject("ADODB.Command") cm.ActiveConnection = objConn
right now I am totally lost with all this, if someone can help would really appreciate it, thanks, debi
Hi i am new to SQL and have been asked to create a page with a SQL database that has got the employees names and numbers on it and i have got to display this on a webpage i have got the sql database on my local pc and have setup the fields and created the database i just need to know how to display the data on a webpage the database name is employees and i have then got fields like email, Name and Department is could someone give me an example using the database name that i have got and the fields or points me to some sites also i would like to place them in coulums how hard is this
when i select the 1st parameter in the report(in webpage) ... then the complete page is getting auto refreshed...same is happening for all the parameter selection...is it not possible to stop it from refreshing....
simply to say i want to get data without refreshing...
few ppl suggested me to use AJAX control but as iam not much familliar with AJAY iam trying to find some other way...can u help me pls....
Ok, just made a TableAdapter and the SELECT statement works fine and pulls data. But doing an INSERT is something different, it craps out wanting a login. No neat Wizard (or so I haven't found yet) that lets me give the TableAdapter the login info for the SQL Server, which I have. Do I need to write code with the login and password for the SQL connection instead? -Ed
Hi, I have a TableAdapter created in a Dataset. I'm creating a search function for a table, and here's how my code looks like in the "Add Query" wizard: Select * from Event where eventname like '%@EventName%' But when I click on preview data, I do not get the prompt to enter a value for the @EventName parameter, where went wrong?