Showing posts with label developing. Show all posts
Showing posts with label developing. Show all posts

Tuesday, March 27, 2012

Adding a new column is DBNULL

Hello,

VS 2005

I am developing the database application. This is a live database and is being used by the customer. I am to release a new version and I had to add new columns to fit the requirements DateStarted (DateTime), and TotalHours(Int) into a database table.There are already over a 1000 rows in this table.

When the customer wants to look at a record in this table and insert the value into the text boxes (Front-end), when it gets to the DateStarted or TotalHours it comes up with a error message:"

The value for column 'DateStarted' in table 'IncidentTask' is DBNull."The method for inserting is:

Code Snippet

Me.dtDateStarted.Value = Me.DsIncidentsControl.IncidentTask(0).DateStarted

What are the possible solutions to this problem? Would it mean checking for a DBNULL before displaying in the textboxes? Or updating the new column rows with an date:

Code Snippet

UPDATE IncidentTask SET DateStarted = '1/1/2005' WHERE (DateStarted IS NULL)

Many thanks for any suggestions,

Steve

You can either have the application check for null values and display an empty string when dbnull,

OR,

UPDATE the table and put a 'dummy' date in all null rows.

Sunday, March 25, 2012

Adding a Delete functionality to my Shopping Cart

Hello,

I'm in the progress of developing a shopping cart system that operates with an SQL database in Visual Web Developer 2005. I've managed to successfully add items to the cart and display them, but I'm having trouble providing the user with the option of removing items from the cart.

My understanding so far is that I've got to adjust the DELETE SQL statement of the data source. At first I was thinking along the lines of a simple statement:

DELETE * FROM ShoppingCart WHERE CartID=@.CartID AND CategoryID=@.CategoryID AND ProductID=@.ProductID

However, I've realised that the parameters I need for this SQL query aren't automatically passed in when a user clicks the "Delete" text of the Delete field (at least I think this is the problem).

The error message which I'm getting when I try to remove an item from the cart is as follows:

Incorrect syntax near '*'.

If anyone could let me know where I'm going wrong and point me in the right direction I'd be really grateful.

Thank you,

Luke

Hi Luke,

There should not be an asterisk (*) in your DELETE statement. If you remove that you might have better luck.|||

Thanks very much for your help - I thought it might have been a really stupid mistake like that! Anyway everything is working fine now.

Thanks again,

Luke

Monday, March 19, 2012

Add user assembly in managed stored procedure

I am developing a managed stored procedure in VS.NET 2005 and I am trying to add a reference to an user developed assembly (not a system one) but adding a reference to it is not possible as it doesnt let me import assemblies but rather reference the few limited ones in a list. Why is this??

There are limitations to what you can do with CLR assemblies, that is the reason for the new SQL Server project template in VS 2005. Try the link below for more detailed info from Microsoft. Hope this helps.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sqlclrguidance.asp

|||I found out how to do it, it can be done. Just add the user developed assembly to the SQL database assemblies and that will make it callable from a managed database object. The downsize as I see it is that you need to keep a repository of assemblies outside of the GAC...

Sunday, March 11, 2012

Add SQL Compact to CE 6.0

I'm trying to add an SQL Compact Edition database to my application running on a CE 6.0 platform that I am also developing. Unlike PB 5.0, I don't see sql CE listed as an option in the catalog and when I try to run my application I get a pInvoke sqlceme30.dll error. I have found a number of references to this same issue elsewhere but no real good solutions. Most seem to point to the cab files not being deployed. I am thinking that I should have the necessary support files deployed in the CE image and I have downloaded and installed every sql CE version/update that I can find but none of them seem to add support to PB 6.0.

I am trying to add the cab files manually but I would appreciate any suggestions if there is a better solution............ Thanks
OK, I got it working with SQL CE 3.5 by manually adding the cabs to the PB catalog........... now I need to figure out how to installe the cabs automatically.

Thursday, March 8, 2012

add reference reporting service to asp.net application

Hi friends,
I am developing the program reporting services using asp.net.
And I just need to add the reference of reporting services for .net,
so how can i do this?
Have you installed the client tools on your dev box? Also, I normally point to the report on the RS server. Also, in sharepoint there are some webparts that will display your reports on a sharepoint site. Let us know which method you prefer, and we can explain better.|||

Hello Kishor_kurapati,

Go to the Project menu -> Add Web Reference.

In the URL box, navigate to the WSDL location on the report server, typicallyhttp://servername/reportserver/reportservice.asmx

This will give you the reporting service proxy class that you can make calls against.

I have some screenshotshere.