.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to stored Amount into database

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net


I have this code:

tbl_Payment tbl_Payments = new tbl_Payment()

             UserId  = UserID,
             PaymentType = DropDownList4.Text,
             AmountDeposit =AmountDeposit.Text,   ERROR!
             Date = DateTime.Now,



If the write value: AmountDeposit = 10, it works!

I have a column in the table AmountDeposit (numeric).

On what it takes to set the column AmountDeposit?




View Complete Post

More Related Resource Links

How to stored datatime into database - linq


Hi, DateTime dt = DateTime.Now; tbl_Payment tbl_Payments = new tbl_Payment() { UserId = UserID, PaymentType = DropDownList4.Text, AmountDeposit =10, Date = String.Format("{0:d/M/yyyy HH:mm}", dt); Compilation Error Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0029: Cannot implicitly convert type 'string' to 'System.DateTime?' Source Error: Line 683: PaymentType = DropDownList4.Text, Line 684: AmountDeposit =10, Line 685: Date = String.Format("{0:d/M/yyyy HH:mm}", dt), Line 686: Line 687: }; Using LINQ for data storage. In Table I column "Date" datetime. How to save a date in the table?


Advanced T-SQL: Automate the Generation of Stored Procedures for Your Database


Design-time automation makes coding faster and ensures that all the procedures generated use the same naming conventions and structure. In an effort to improve their coding efficiency in a large SQL project, the authors wrote a set of design-time stored procedures that generate run-time stored procedures, and have used them in project after project ever since. Recently, the authors updated their procedures to make use of SQL Server 2000 features, including user-defined functions. This article covers the creation and execution of these dynamic T-SQL scripts to automate the coding of common database stored procedures.

Peter W. DeBetta and J. Byer Hill

MSDN Magazine April 2003

SharePoint List with Hyperlinks Stored in a Database


To all,

I need to display a List of Hyperlinks that are stored in a database. I want it to be a SharePoint List so it can be Indexed and Search properly in SharePoint.

SharePointSite Table - Columns:SiteName(nvarchar(256)), URL(nvarchar(256))

Example: Acme Foods, http://www.acme.com

I need a List that shows:

Acme Foods and is a clickable hyperlink  to http://www.acme.com

What is the best way to get access to the data and feed it to a List and then host it on a Site landing page?

This is meant to be a directory of Site Collections. We have 175 Site Collections that host our customers Report Libraries.



How to stored values 10.57 into database



I have the variable value 10.57
10.57 If I write, it stores data: 1057.00

 I need 10.57 into database


Execute SSIS package stored in Database - From Stored Procedure

Dear frnds, I am trying to execute a SSIS package that is stored in a SQL Server 2005 database Want to execute from a stored procedure in same database.  What commands/operations are necessary ? I am also having Two parameter. Regards, sajid 

Security problem with cross database chaining and stored procedures

I have a situation whereby ProcA exists on database A, but ProcA executes about 20 stored procedures scattered across different databases. To further complicate matters some procs that ProcA calls also call other procs in other databases, this then presents the problem of cross database chaining where you can’t really write to a database from a proc that resides in another database. I am wondering how I can get around this problem, I know I can simply let open cross database chaining and the problem will go away, the other option is to create a proxy which is very complicated and wouldn’t work in my environment. Is there any way around the problem.

Displaying Image stored in rtf format in access database displaying it on crystal report

Hello, I'm working on a C# project combined with "Crystal Reports 10". When a user inserts something in a "TextField" in my C#-Program, it's saved  as RTF-code (Bolt,Pictures,Underlined,....) to a database.. So if they  reopen it in my "C#"-program they're able to see what they've entered  including their pictures .... But when I created a "Crystal Report"-file and combined it with the same  database used in my "C#"-program, it only show the formatted text and not  the pictures or images... Is there a way to show the "Picture" or "Image" they've inserted in RTF-code  ??? When I copy the code from the database in a simple Text-File and rename  it too "Test.rtf", it wil open correctly in word (with picture and  everything else)... So I hope there is a way to get the picture, Cz it's rather important  they've got a picture of the product they wanna print ...

Update Database Record using GridView and Stored Procedure

Hi, I am trying to update record via stored procedure, but i got error at very start point. Problem is when i click on Edit link button within the Gridview it produce error. I can populate values from database fine but its produce error when i click on edit link button. Please see the code below. *********** ASP.net GridView Code I am using *****************<asp:GridView ID="GridView1" runat="server" DataKeyNames="RollID, EmpID" AutoGenerateColumns="False" Width="700px"> <Columns> <asp:TemplateField HeaderText="ApplicationID" Visible="false"> <ItemTemplate> <asp:Label ID="AppsID" runat="server" Visible="false"><%# Eval("RollID") %>'</asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="ReleaseID" Visible="false"> <ItemTemplate> <asp:Label ID="rlsID" runat="server" Visible="false"><%# Eval("EmpID") %></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Roll Name"> <ItemTemplate> <asp:Label ID="rlsVersion" runat="server"><%# Eval("Roll_Name")%></asp:Label> </ItemTemplate> <EditI

Managing TypedDataSets when there is a change in backend Table / Stored Procedure / Database schema

Hi All, I am just curious to know if there is any easier way to synchronize the TypedDataSets with the chages made to backend Table / Stored Procedure schema.  I use Typed DataSets in my project extensively and I found them very useful and easier to code, but difficult to maintain  The difficuly I have always faced is whenever there is a change in a backend database table structure or stored procedure that is linked to any of the Typed DataSet in our project requires to recreate whole DataSet again by scrapping the old one. The backend changes will not be reflected unless and untill you recreate the whole stuff again. Is there any easier way to synchronize those typed datasets with the changes made to backend database schema or any other workaround that will not required to recreate the whole DataSet again.Hope above question makes sense. Any ideas.

Calling Stored Procured in SSIS from database moving data into another Database




I am just wondering if this is a feasible option within SSIS.

I have a source database on one server, a destination database on another server

The source database has a stored procedure which returns lets say 500 records. 300 are inserts the rest updates. (Based on some column)

So in SSIS I call this SP, following this im able to loop through the records returned figure out wether its Insert or Update and then move the data to destination table.



Need to extract .pdf attachments stored in MS SQL 2005 database


I have several thousand service tickets store in a sql database.  Many of these have attachments such as email, pdf, screen shots, etc.  The attachment is stored and identified in .dat format.

Can anyone help me extract these attachments into a format (s) where I can see them properly.

My table looks like:

idRecord   SvcId     Fileid                         Filedata

18            1           000000.20.dat            0xFFDIFFE000 . . .


Need to execute ALTER DATABASE inside stored procedure


SQL 2005 Standard.

I wrote a sp that uses ALTER DATABASE instruction. When I execute sp with elevated user it works fine; when I try to execute that sp with a normal user (I alerady gave execute permission for that user) it fails with "alter database failed".

I tried to modify create proc with execute as owner but nothing changed.

How can I do ?


C# How to check prammatically if null value exists in database table (using stored procedure)?


How to programattically check if null value exists in database table (using stored procedure)?

I know it's possble in the Query Analyzer (see last SQL query batch statements)?

But how can I pass null value as parameter to the database stored procedure programattically using C#?

Although I can check for empty column (the following code passes string.Empty as parameter but how to pass null value?), I cannot check for null value in the following code snippet:

SQL Queries:

USE [master]

IF EXISTS (SELECT name FROM sys.databases WHERE name = 'ExampleDatabase')
DROP DATABASE [ExampleDatabase];

CREATE DATABASE [ExampleDatabase];

USE [ExampleDatabase];

DROP TABLE dbo.ExampleTable;

IsActive BIT,


Romanian Texts( a a A  âÎ îS s T t) are not stored properly in SQl Server database

In my application im using romanian language texts also. but these romanian text(a a A   âÎ îS s T t) are not stored properly in the SQL database.
Im using the data type for that field as nvarchar and the collation as SQL_Latin1_General_CP1_CI_AS.

Can anyone help me to resolve this issue.


Restoring sql server database with stored procedures



I have a database that needs restoring to get a website up and running.  I am not a ASP developer (am PHP) and therefore have never used SQL Server before.

I have just tried to import one of the tables from a .txt file using SQL Server Management Studio 8 and instead of the column names being inputed, it just has "column 0", "column 1" etc.  I have noticed that I have a folder full of stored procedures, am I supposed to import these first?  Im not 100% what these stored procedures are for or the best way for me to import all this data successfully as I have so many files it will take forever to import one by one.  I dont mind doing it one by one if I have to but just want to ensure I do it all correctly first time!

Many thanks

Does whole site collection data stored only on database


Hi All,

Does the whole data belonging to site stored in database or part of the data also gets stored some where else? We have restored a content database but few stes are missing on new server and when we take the backup of site on new sevrer the backup comes as 100 KB , but if we take the site backup on new server the backup size comes as 6GB, tht is a big difference. So i am a dba and have no idea on how the sharepoint stores the data. Please advice...

Database Tuning Advisor, Stored Procedure with datetime parameters, syntax error


I receive these error(s) in the Tuning Log. I have several stored procedures and they all use a datetime parameter.

E000    exec <some sproc name> ''2009-01-01 00:00:00:000'',''2010-09-30 00:00:00:000'',N'',N'',NULL,NULL,NULL,NULL,NULL,NULL         1    [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near '2009'.

I am using SQL 2005. Any suggestions?

Thanks, Reece

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend