Hello,
I created a class in my .Net code and I have an SQL 2005 table with a column of type image (I suppose I should use this type)
After I define the class properties I need create a new record and save the class in the database.
Can I do it the same way as I would save, for example, a string in a varchar field?
I had just installed SQL 2005 dev on my laptop and got an error message when I tried to create a package using the BI IDE. I received the same error using VS2005 IDE. But the project was created regardless without any packages. When I tried to create a new package in the project, I received the same error again, but with an option to view the error details.
Following is the text of the error details:
TITLE: Microsoft Visual Studio ------------------------------
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..............
Hello:I didn't find any documentation that notes save point names are casesensitive, but I guess they are...Stored Proc to reproduce:/* START CODE SNIPPET */If Exists (Select * From sysobjects Where Type = 'P' and Name ='TestSaveTran')Drop Procedure dbo.TestSaveTranGoCreate Procedure dbo.TestSaveTranAsBeginDeclare@tranCount int--Transaction HandlingSelect @tranCount = @@TRANCOUNTIf (@tranCount=0)Begin Tran localtranElseSave Tran localtranBegin Try--Simulate Error While ProcessingRAISERROR('Something bad happened', 16, 1)/*If this proc started transaction then commit it,otherwise return and let caller handle transaction*/IF (@tranCount=0)Commit Tran localtranEnd TryBegin Catch--Rollback to save pointRollback Tran LOCALTRAN --<< NOTE case change--Log Error--Reraise ErrorEnd CatchEndGo--Execute Stored ProcExec dbo.TestSaveTran/*Should receive the following message:Cannot roll back LOCALTRAN. No transaction or savepoint of that namewas found.*//* END CODE SNIPPET */What is really strange, if there is a transaction open, then no erroris thrown. So if you execute as so:/* START CODE SNIPPET */Begin Tran--Execute Stored ProcExec dbo.TestSaveTran/* END CODE SNIPPET */There is no "Cannot roll back LOCALTRAN...." message.Questions:1-)Can someone confirm save point names are case sensitve and this isnot happening because of a server setting?2-)Is this a logic error that I am not seeing in the example codeabove?We have changed our code to store the save point name in a variable,which will hopefully mitigate this "problem".Thx.
I am new to sql sever management studio express, but a long time query analyzer user. This is a very basic question.
I want to change the default directory in sql server management studio express so that when I go to save a query, it is already pointed to the correct one. Where do I change that?
Does anybody know of a good facility to take a SQL 2000 to SQL 2005 Admin course that is geared towards experienced DBAs, that is not so costly. I'm not the type that can sit and read on my own to learn, it has to be a real project or a classroom environment.
Just started SQL Class and I am struggling with an assignment. Would someone be kind to give me some help please?
your task is to make a stored procedure that will only billcustomers making monthly payments higher than $500.A Customer can have multiple Plans (services for which they pay amonthly fee).
You have to execute a billing procedure for each single active planunder an eligible customer account. Eligible customer account is anaccount that makes estimated monthly payment higher than $500.
You are given 2 tables, "Customers" and "Plans". Table "Customers" has columns: CustomerID, EmailAddressTable "Plans" has columns: PlanID, CustomerID, MonthlyPrice, isClosed,NextBillDate
Also, you are given two stored procedures named "Bill_Plan" and"Send_Email". All stored procedures returns 0 upon success and negativenumber upon failure.The "Bill_Plan" actually bills a customer for a plan. The storedprocedure takes one input parameter and have one output parameter.
You have to use the output parameter @NextBillDate to updatePlans.NextBillDate with its new value.
Upon successful billing you have to send en email to the customer'semail address. The "Send_Email" stored procedure takes two inputparameters. Send_Email @sEmailAddress = @EmailAddress, @sSubject = 'Your Invoice is Ready' You have to rollback any single billing transaction upon any kind offailure and continue billing the remaining plans. (Important!!!)
Hello, I have the class below. And trying to execute it on a button click event. What am i doing wrong ? Thanks Here is the button click event1 protected void Button1_Click(object sender, EventArgs e) 2 { 3 signup_data_entry signup = new signup_data_entry(); 4 signup.signup_data_entry(); 5 6 }
Here is my class file. please advice 1 public class signup_data_entry 2 { 3 public signup_data_entry() 4 { 5 //SqlConnection con = new SqlConnection("cellulant_ConnectionString"); 6 SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["cellulant_ConnectionString"]); 7 8 SqlCommand command = new SqlCommand("Cellulant_Users_registration", con); 9 command.CommandType = CommandType.StoredProcedure; 10 11 con.Open(); 12 13 //string IP = new string(); 14 15 16 command.Parameters.Add(new SqlParameter("@RegionID", SqlDbType.Int, 0, "RegionID")); 17 command.Parameters.Add(new SqlParameter("@RegionDescription", SqlDbType.NChar, 50, "RegionDescription")); 18 19 command.Parameters[0].Value = 4; 20 command.Parameters[1].Value = "SouthEast"; 21 22 int i = command.ExecuteNonQuery(); 23 24 25 } 26 }
hiiiiiiiiii I am creating a web application using vb.net in which i m using the concept of classes. now i am done all the code for inserting the values in the database using the class but it is difficult to fetch the values from the database using select command and sending them to a WebForm . i want to know how i send send the values coming from the select command to a datagrid or another web controlif possible provide me a sample code thanks for your help
there was a post some time ago but nobody answered. Maybe somebosy will answer now?
I have created a class which contains a few UDF's. The class has a static constructor that reads from the databse and loads a Dictionary<> collection.
What is the lifetime of the class? What will cause the static constructor to be called again? When will it be garbage collected? If the life time is limited by default, can it be extended?
I'm tasked with creating POCO (C# Class Object) and XML definitions for three different kinds of records coming from my input file. The problem is that I'm not sure how to do this within the SSIS framework. It seems to me that I can somehow define a class and include XML element tags in the definition, but I'm not sure where to look/who to ask/how to do that!
The goal is to be able to assign the data types and class attributes for various parts of each input record based on position, and to serialize the data as XML (and therefore my inputs to my Data Flow will be XML objects instead of a flat file, as I had been doing it...).
Can anyone point me at a good tutorial? Or a simple example?
I recently took a class on SQL 2005. The classwork had lab files but I did not manage to hang on to the files. Are those files available for DL from MS?
I am specifically looking for the files from Module 7 "Planning for Source Control, Unit Testing, and Deployment"
Does anyone have any experience with this object, or any working examples, I suspect I'm still missing some permissions thing but at the moment all I get is this annoyingly unhelpful message:
Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: --
BODY {font-family:Verdana;font-weight:normal;font-size:8pt;color:black;} H1 {font-family:Verdana;font-weight:700;font-size:15pt;} LI {font-family:Verdana;font-weight:normal;font-size:8pt;display:inline;} .ProductInfo {font-family:Verdana;font-weight:bold;font-size:8pt;color:gray;} A:link {font-size:8pt;font-family:Verdana;color:#3366CC;text-decoration:none;} A:hover {font-size:8pt;font-family:Verdana;color:#FF3300;text-decoration:underline;} A:visited {font-size:8pt;font-family:Verdana;color:#3366CC;text-decoration:none;}
Reporting Services Error
An internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help
For more information about this error navigate to the report server on the local server machine, or enable remote errors
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.
Hi, I'm working on both VWDEE and VBEE and, in each, when I try to add a database diagram I get the following message (after the 'Do you want to create required objects' prompt) 'Invalid Class String'. Any ideas?
Hello, I put my stored procedure in my class and try to execute it but get this error 1st here is my class 1 public signup_data_entry() 2 { 3 SqlConnection con = new SqlConnection("cellulant_ConnectionString"); 4 5 6 SqlCommand command = new SqlCommand("Cellulant_Users_registration", con); 7 command.CommandType = CommandType.StoredProcedure; 8 9 con.open(); 10 11 command.Parameters.Add(new SqlParameter("@RegionID", SqlDbType.Int, 0, "RegionID")); 12 command.Parameters.Add(new SqlParameter("@RegionDescription", SqlDbType.NChar, 50, "RegionDescription")); 13 14 command.Parameters[0].Value = 4; 15 command.Parameters[1].Value = "SouthEast"; 16 17 int i = command.ExecuteNonQuery(); 18 19 20 }
and here is the error message on the testing server. Error line is line 27 below
Source Error:
Line 25: command.CommandType = CommandType.StoredProcedure; Line 26: Error >>> Line 27: con.open(); Line 28: Line 29: command.Parameters.Add(new SqlParameter("@RegionID", SqlDbType.Int, 0, "RegionID"));
HI, I am going to make a big web application. so im going to use sql connection with class for example i have 100 web pages and i will make a slq connection in class.vb Class1.vb(see the below code) Imports System.Data Imports System.Data.SqlClient Imports Microsoft.VisualBasicPublic Class Class1 Private conn As New SqlConnection("Data Source=DANISHSQLEXPRESS;Initial Catalog=ARBASHHR.MDF;Integrated Security=True")Private cmd As New SqlCommand() Private da As New SqlDataAdapter(cmd) End Class default.aspx(here is asp.net page i want to use the sql connection from that class.) but this below page saying that Name "cmd" is not declared and connection Try cmd.Connection = conn conn.Open()Dim ds As New DataSet cmd.CommandText = "SELECT * FROM Users where (UserName = N'" & TextBox1.Text & "')" 'And (Password = N '" & TextBox2.Text & "')"da.Fill(ds, "data") conn.Close() For Each dt As DataTable In ds.Tables For Each dr As DataRow In dt.RowsTextBox3.Text = dr.Item("Password") Next drNext dt If TextBox2.Text = TextBox3.Text ThenResponse.Redirect("Welcome.aspx") Else Label3.Text = "Invalid Username/password" End IfCatch ex As Exception ' MsgBox(ex.Message) '("Error Loading Information From Database..", MsgBoxStyle.Critical, "Error") End Try End Sub please let me know where im doing mistake..... Thank in Advance
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
hate to gripe, but this was bad. I have taken several sql server classes over the years, and have always been happy with the class, but avoid the 2733a (upgrading you database administration skills to sql 2005). Class is poorly devloped and incomplete. Half of the examples were to do things such as mirroring and replication from a command prompt. I thought I was in an Oracle 8 class. It was clear much of this functionality is not complete. In fact most of the class was command prompt based. They had absolutley nothing about the upgrade process from SQL 2000 to SQL 2005. I hope MS is not taking a step backwards, I always thought the strong suite for MS was the enterprise manager tool suite. The instructor did tell me there was an upgrade to the class that just came out, but it has a long way to go.
When viewing trace information via SQL Profiler, you can see the name of the event class. But when viewing trace information via T-SQL (either from a trace table or trace file using ::fn_trace_gettable), you see the id of the event class and not its name.
If I knew the name of the event class, then I could easily find the id by drilling down from this BOL article: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/0f0fe567-e115-4ace-b63c-73dc3428c0f6.htm
For instance, I recently captured Lock:Acquired event class from the Locks event category. I can see from BOL that its id is 24 by drilling down into Locks:Acquired Event Class from the above link. I just have to view the Description field for EventClass data column.
Is there a way to do this in reverse, meaning if I knew the id of the event class, could I find the name easily? Is SQL Profiler using a built-in function to convert the id to a name?
I've searched through BOL for this information, but haven't been able to locate an article that lists all of the event classes by id and their associated names. I've also scoured Google for this information and haven't been able to locate it.
Tara Kizer Microsoft MVP for Windows Server System - SQL Server http://weblogs.sqlteam.com/tarad/
I am trying to port a database from SQL Server 2005 Express to SQLServer 2005 Standard. Idetached my database from the SQL Sever 2005 Express instance andattached it to the SQL Server 2005 Standard instance. Whenever I do aselect on tables in the database I have no problem. However if Iattempt to open or modify a table by selecting open or modify from thepopup menu, I get the following error --TITLE: Microsoft SQL Server Management Studio------------------------------Class does not support aggregation (or class object is remote)(Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION))(Microsoft.SqlServer.SqlTools.VSIntegration)------------------------------BUTTONS:OK------------------------------I tried repairing the .NET 2.0 framework but to no avail.Please help!!!Thanks,
I´m wondering if is it possible to use the SSIS Class Library without SQLServer installed in the machine or if is it necessary to install SLQ Server in order to use SSIS objects?
Has anyone downloaded the DVD splits for the 7031A class yet?
After I downloaded all of the files I created the Instructor DVD to have the VMC/VHD files for the class setup but there were no Virtual Disk files in the "Drives" folder...only a text file called "placeholder".
Any ideas on how to get the BCBase.exe, Upgrade.exe, InPlace.exe, SideBySide.exe and SQL7Upgrade.exe files?
I have several fuctions that I would like to share between my different script tasks in my SSIS package. I assume I do this by creating a custom class, but I cant quite figure it out. Can someone please point me in the right direction?
I can't find the ReportingService's namespace... i see ReportingService inerhits from System.Web.Services.Protocols.SoapHttpClientProtoco but any code what i found its impossible to compile, i need the namespace...