Manage Exception Message
May 26, 2006
How to manage sql server runtime message to users understand it?
In my web form I added folowed code
If Session("Action") = "Edit" Then
Try
ObjectDataSource1.Update()
Catch ex As Exception
lblMessage.Text = ex.GetBaseException.Message
End Try
for manage user input for update the record.
This is message returned by sql server 2005
The UPDATE statement conflicted with the REFERENCE constraint "FK_DEVIZE_RELATION__DRZAVE". The conflict occurred in database "Trgo2006", table "dbo.Devize", column 'Drzava'. The statement has been terminated
This message not understand for users. How to manage messages retrned by sql server, or prepare exception to return message understanded for users.
View 1 Replies
ADVERTISEMENT
Jan 16, 2008
Greetings everyone, I am attempting to build my first application using Microsofts Sql databases. It is a Windows Mobile application so I am using Sql Server Compact 3.5 with Visual Studio 2008 Beta 2. When I try and insert a new row into one of my tables, the app throws the error message shown in the title of this topic.
'((System.Exception)($exception)).Message' threw an exception of type 'System.NotSupportedException'
My table has 4 columns (i have since changed my FavoriteAccount datatype from bit to Integer)
http://i85.photobucket.com/albums/k71/Scionwest/table.jpg
Account type will either be "Checking" or "Savings" when a new row is added, the user will select what they want from a combo box.
Next is a snap shot of my startup form.
http://i85.photobucket.com/albums/k71/Scionwest/form.jpg
Where it says "Favorite Account: None" in the top panel, I am using a link label. When a user clicks "None" it will go to a account creation wizard, and set the first account as it's primary/favorite. As more accounts are added the user can select which will be his/her primary/favorite. For now I am just creating a sample account when the label is clicked in an attempt to get something working. Below is the code used.
private void lnkFavoriteAccount_Click(object sender, EventArgs e)
{
FinancesDataSet.BankAccountRow account = this.financesDataSet.BankAccount.NewBankAccountRow();
account.Name = "MyBank Checking Account";
account.AccountType = "Checking";
account.Balance = Convert.ToDecimal("15.03");
account.FavoriteAccount = 1;//datatype is an integer, I have changed it since I took the screenshot.
financesDataSet.BankAccount.Rows.Add(account);
//The next three lines where added while I was trying to get this to work.
//I don't know if I really need them or not, I receive the error regardless if these are here or not.
this.bankAccountTableAdapter1.Update(financesDataSet);
this.financesDataSet.AcceptChanges();
refreshDatabase();
}
the refreshDatabase() code is here:
private void refreshDatabase()
{
this.bankAccountTableAdapter1.Fill(this.financesDataSet.BankAccount);
//Aquire a count of accounts the user has
int numAccounts = financesDataSet.BankAccount.Count;
//Loop through each account and see which one is the primary.
for (int num = 0; num != numAccounts; num++)
{
//Works ok in frmMain_Load, but when my lnkFavoriteAccount_click calls this, it throws the error.
if (this.financesDataSet.BankAccount[num].FavoriteAccount == 1)
{
//Display the primary account on our home page. User can click the link label & be taken to their account register.
this.lnkFavoriteAccount.Text = this.financesDataSet.BankAccount[num].Name.ToString();
this.lnkFavoriteFunds.Text = this.financesDataSet.BankAccount[num].Balance.ToString();
break;
}
}
}
and my form_load code
private void frmMain_Load(object sender, EventArgs e)
{
refreshDatabase();
}
So, when I click on the lnkFavoriteAccount label, and my new row gets added, the app stops at the following line in my DataSet.Designer
[global:ystem.Diagnostics.DebuggerNonUserCodeAttribute()]
public byte FavoriteAccount {
get {
try {
return ((byte)(this[this.tableBankAccount.FavoriteAccountColumn]));
}
catch (global:ystem.InvalidCastException e) {
//Stops at the following line, this error was caused by 'if (this.financesDataSet.BankAccount[num].FavoriteAccount == 1)'
throw new global:ystem.Data.StrongTypingException("The value for column 'FavoriteAccount' in table 'BankAccount' is DBNull.", e);
}
}
set {
this[this.tableBankAccount.FavoriteAccountColumn] = value;
}
}
I have no idea what I am doing wrong, all of the code I used I retreived from Microsofts help documentation included with VS2008. I have tried used my TableAdapter.Insert() method and it still failed when it got to
if (this.financesDataSet.BankAccount[num].FavoriteAccount == 1)
in my refreshDatabase() method it still failed.
When I look, the data has been added into the database, it's just when I try to retreive it now, it bails on me. Am I retreiving the information wrong?
Thanks for any help you guys can offer.
Johnathon
View 1 Replies
View Related
Dec 29, 2007
hi
Where can find the Manage SQL Server Message in SQL 2005. Just like the one in Enterprise Manager SQL 2000 under the tools menu? Thanks
View 1 Replies
View Related
Feb 4, 2008
Hi,
I found this error while reviewing my logs. I'm not very good with indexes, and the indexes I am using have been generated from the sql wizard. I'm not getting this error on everyquery, just randomly. Is this cause for concern? Why would some queries fail but others not?
Thanks for any assistance!
much appreciated,
mike123
Exception information:
Exception type: SqlException
Exception message: Operation failed. The index entry of length 996 bytes for the index 'tblInstantMessage25' exceeds the maximum length of 900 bytes.
View 3 Replies
View Related
Aug 11, 2006
Hello everybody,
I've encountered a strange thing using a CLR Stored procedure:
The procedure throws an exception with no message inside... value = {" "}
Basically the procedure has a string as argument which contains a SQL statement that changes according to the users selections...
The results of the query are saved into a dataset for further processing.
Those resultsets can sometimes be very big (ex: 15000 records...). (For the record the procedure works fine for smaller datasets ex 6000 records and running the same query on the application server returns the expected resultset )
By Debugging the procedure I could determine that the failing point was when the dataset is filled...
Anyone having any idea??
The only information I have from this exception is the stacktrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.CloseInternal(Boolean closeReader)
at System.Data.SqlClient.SqlDataReader.Close()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at DataAccess.runScalar(String strSQL, Boolean isStoredProcedure) in c:InetpubwwwrootStatistixApp_CodeDataAccess.cs:line 114
Thanks in advance
Alaindlk
View 5 Replies
View Related
May 7, 2008
I have an app running Windows CE 5.0 and SqlServerCE 3.0. Occasionally, one of the production units will throw an exception with the following stack trace but no exception message:
Exception Msg:
Stack Trace: at System.Data.SqlServerCe.SqlCeCommand.ProcessResults()
at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand()
at System.Data.SqlServerCe.SqlCeCommand.ExecuteReader()
at System.Data.SqlServerCe.SqlCeCommand.ExecuteReader()
at XX.MobileApp.frmXXX.LoadData()
This is not something that I have been able to reproduce in our shop. I even take their database and run it here in our shop with out such errors. Does anyone know some possible causes for this error?
Sorry, I don't have more info to give becuase this is all I have to work with since I cannot reproduce in our shop. If the exception object exposes a property for the HResult, I would be able to provide that.
I appreciate your repsonses.
View 1 Replies
View Related
Jan 31, 2007
Hi,
I got an strange problem with one of my packages.
When running the package in VisualStudio it runs properly, but if I let this package run as part of an SQL-Server Agent job, I got the message "The script threw an exception: Exception of type 'System.OutOfMemoryException' was thrown." on my log and the package ends up with an error.
Both times it is exactly the same package on the same server, so I don't know how the debug or even if there is anything I need to debug?
Regards,
Jan
View 2 Replies
View Related
Jul 23, 2007
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 3 Replies
View Related
Aug 8, 2007
I run SB between 2 SQL servers. In profiler on an initiator side I see next error: 'This message could not be delivered because its message timestamp has expired or is invalid'. For the conversation we use best practice, i.e. target closes a conversation. Target side succeed to close conversation, but initiator still stay in DO (disconnect_outbound).
What is a reasone for the error? What to do?
View 5 Replies
View Related
Aug 8, 2007
I see in profiler this error: "This message could not be delivered because its message timestamp has expired or is invalid"
What is a reason for error?
View 1 Replies
View Related
Oct 27, 2006
Hey EveryoneI have a desktop machine and a laptop machine. Both have XP Pro. I prefer to code on my laptop, but I want to use my desktop machine as a home server/development environment because its always on. I have IIS (HTTP and FTP), .NET 2.0, my mp3 server, etc up and running just fine on my desktop.When I'm working on an application, I access the site with VWD through a network share. It's worked great so far. What I haven't been able to do, however, is connect to the database with VWD or Management Studio Express. I don't even really know where to begin with this one. What I don't want to do is open this up to the internet. I'd like to just keep it accessible from the LAN (the database, not the website)I'm new to database stuff, and I don't really know where to look to figure out how to do this. Basically, I want to have the same functionality with VWD or Management Studio that I would have if I was physically on the machine with the SQL Express server.If anyone can provide some advice, I'd really appreciate it.Thanks!Brandon
View 6 Replies
View Related
Apr 14, 2008
Hello,I am working on an ASP.NET web site using an SQL database. Is there a way to Insert/Delete and Update data in the database without creating all the forms in ASP.NET?Since I am the only person to work with the database it would be easier for me than creating all ASP.NET forms.Thanks,Miguel
View 1 Replies
View Related
May 28, 2007
How do you manage your remote MS SQL?
I have worked with mysql for sometimes now and everywhere there was a mysql there was phpmyadmin for managing it but now on my new windows hosting with plesk I don't see such program. The only thing I see is a pothetic program called ASP.NET enterprise manager that doesn't allow uploading data.
.
View 3 Replies
View Related
Jun 11, 2004
Before I just manage the SQL serve in LAN.
Right now i have a SQL server on internet I want to Remote manage
Can I still use QA and Enterprise Manager ?
View 5 Replies
View Related
Apr 14, 2008
Hello,
I am working on an ASP.NET web site using an SQL database.
Is there a way to Insert/Delete and Update data in the database without creating all the forms in ASP.NET?
Since I am the only person to work with the database it would be easier for me than creating all ASP.NET forms.
Thanks,
Miguel
View 2 Replies
View Related
Mar 27, 2008
In a previous application i stored about 100.000 actions ( coming from an external system )in an access database for each day. Therefore i created everyday a new accessdatabase to have enough performance. Each month i copied automatically all databases in a new 'month' map as a backup.
The goal of the application is the view all actions of one day of week in one grid. This is a kind of history of the external system.
I'm afraid the application will become to slow if i save all actions in one database. ( after 1 month i will have 3.000.000 actions.
How this is done in an sql server ?
Do i have to use a different kind of method ?
View 2 Replies
View Related
Jul 3, 2006
is there any datatye that can accept 16 digit number
View 4 Replies
View Related
May 24, 2007
Say for example I have the following 2 database tables, the first one contains the old employee data, and has the fields shown below:
oldEmployeeID
FirstName
LastName
DateOfBirth
HiringDate
TerminationDate
and another one containing the new employee data with similar fields but instead of oldEmployeeID, it is showing the newEmployeeID.
During the conversion process, something were messed up and instead of putting in the original hiring date of the workers into the new employee database, the conversion date was put in, which, depending on the mood of HR ladies, could be any date, and at the same time, of course, new employee join the company, and we assume their hiring dates were entered correctly. On top of that, there are some employee who were terminated before the conversion took place but we still need to keep a record of that.
And I created a third table, say, emplyeeAll with similar fields to the employee data tables.
So here is what I need to do: if the firstName, lastName and DateOfBirth in the old employee data table and the new employee data table matches, I would assume they are the same employee, hence I would put the information for the employee obtained from the new employee data table to the employeeAll table, with the Hiring Date changed to the Hiring Date of the old employee data table (and do not copy the record from the old employee table to prevent duplicates), otherwise, I would simply copy and paste the data in new and old employee table to my employeeAll table.
I know this is really confusing, but...well...hope you know what I am saying...
Is it possible to have a SQL statement for all these? If so, how should the statement looks like?
Thanks a lot!
Regards,
Anyi
View 6 Replies
View Related
Aug 5, 2007
I have been having "fun" trying to get all the bits (SSCE 3.5, Orcas Beta 2, SQL Managment Studio) in Vista 64 and Xp 32.
So far I have found at the SQLMetal does work with SSCE 3.5 but not in Vista64
BUT I cannot get any tool (tried SQL and SLQ express) to manage my SSCE db - ie make relationshipos so that SQLMatal can do its stuff
Any advice as to which tool to use to manage SSCE 3.5
Thanks
Mike
View 5 Replies
View Related
May 18, 2007
Hi
How i can manage a DTS Package usin Asp.net
View 1 Replies
View Related
Jun 5, 2007
Hi,
I'm currently migrating to Sql 2005 from 2000 and have a quick question about indexes.
In 2000 i used to click on Table > All Tasks > Manage Indexes... to view and create all my table indexes. There doesn't seem to be anything similar in 2005 Management Studio. I thought it was under Table > Modify but there's nothing there for indexes. I've had to create all my indexes manually through t-sql but this doesn't help when needing to view and manage current indexes.
Can anyone help me on this?
View 2 Replies
View Related
Dec 30, 2007
Hi All
It´s my DropDownList data source from my page1.aspx:
<asp:DropDownList ID="ddlChampionships" runat="server" DataSourceID="sdsSearchChampionships" DataTextField="name" DataValueField="id_championship"> </asp:DropDownList><asp:SqlDataSource ID="sdsSearchChampionships" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [Tupi_Campeonatos]"></asp:SqlDataSource>
When I put a new championship name in a TextBox and click on the button "ADD", this button event click is called:
Protected Sub btAddChampionship_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btAddChampionship.Click
insertNewChampionshipIntoDataBase()
End Sub
The Page then reloads but my DropDownList is not updated. The way I found to do it is to put the DDList update code after the calling of the insertNewChampionshipIntoDataBase() method, but how???
thnx
View 2 Replies
View Related
Jul 25, 2005
What admin tool do I use to create databases, stored procedures, etc in the Sql Server 2005 CTP?
View 9 Replies
View Related
Jan 4, 2006
How can I create a script that will set all the permissions for a specific user for some objects in a database?
Thx in advance.
View 2 Replies
View Related
Apr 12, 2008
Hi Fellas,
I have a problem and it is described as follows:
1. The user may browse any website on the internet that may be in any language and enter the data into my application.
2. The data entered can be in English or any other language.
3. That’s were the problem arises; the data that enters the database other than English is displayed in wrong format like small boxes.
4. The user who had previously entered the data in the database can also alter that data. So when I display the data (other than English) to him it is not in the format in which the user had entered.
So can anybody help me out how to manage multilingual data?
View 2 Replies
View Related
May 23, 2006
I have a user that I have granted the server role "securityadministrator" and a database role "db_securityadmin". When logged inas this user I can create new logins but not run sp_adduser to add thenew login to as this says I don't have permission to do this. I canhowever run sp_revokedbaccess to get rid of a user from the database.
View 2 Replies
View Related
Jul 26, 2007
Hello,We have an XP workstation containing a very important MSDE-basedapplication. Its MSDE database isn't likely to change for quite awhile.The app contains an internal backup method (File, Backup, Backup) andan auxiliary app/script for shrinking the database and logs. I wouldlike to automate the backup and shrinking so end users don't have toremember to do them.The workstation has a static IP so it can go out to the Internet whennecessary.The workstation is presently not joined to the domain.1. Can I install SSMS Express *only* as a local app (without SQLExpress 2005) and thus use SSMS to set up nightly backups and periodicshrink database/logs jobs??2. We have SSMS running on SQL 2005 server box in the domain. If Ijoin the workstation only to the domain (local account logon is notchanged, still used), could I use SSMS from the SQL 2005 box?? Would Ineed a domain login on the XP box to make this work??Thank you, Tom
View 1 Replies
View Related
Oct 13, 2006
I want to manage my sql express .mdf database file (e.g. set Roles) but I seem to only be working with a temporary instance of my database when I attach to .sqlexpress and manage in SQL Server Management Studio Express (SSMSE). The Role I set is gone when I detach and re-attach.
If I try to manage my file in Visual Studio under Server Explorer, I do not see the "Roles" folder to modify roles.
Any help is appreciated.
View 3 Replies
View Related
Apr 15, 2008
Hi
I have SQL server admin id and password, and I want to do some create/delete new database, or mimium do some select statements. What do I need to install on my workstation in order to connect to SQL server remotely? What's the equivalent tools as SQLPlus in Oracle?
Thanks
Jirong
View 5 Replies
View Related
Aug 18, 2006
Hi all,
At our facility, we have a > 350 gigs database and the DB is breaking into 2 files. One file is our Image table with the size of 300 gigs. The other file contains all of the other tables. The image file is getting bigger and bigger everyday, I am worry that eventually when a data file getting too big it could lead into problem. - DB fragmentatio, hard to manage etc
My question is anyone has run into this problem, and how do you solve it?
I am open for any suggestion.
BTW: I am using SQL 2000.
Thanks in advance.
View 9 Replies
View Related
Jun 9, 2005
(Also posted on the beta newsgroups...)
View 16 Replies
View Related
Jul 8, 2015
i've a server which is reside in remote area. my database store in drive E where disk capacity is 1000 GB and DB size reached 800GB , now disk free space showing 10 GB only . how to manage space.couple of week back i've tried to shrink the database but it is not completed successfully and since the time db size drastically increase. now i'm sitting in corner.can we perform partial shrink only on MDF. so that we can manage the space (starting from 10 gb only)
View 33 Replies
View Related