I have a little problem concerning the saving in two associated tables !
explanation :
i am using sql server 2008 and MVC 1.0
for the saving and edition i used the standard methode, wich is (using control and repository classes, and then "the add view" fonctionality).
in my case , i have a table A associated with another table B, this means that in the A i have other columns belonging to the table B, but when using the Add view, it doesn't add the ather column of the table B, even if in the sql server, in the design of the table i find these columns!
the code for grabbing data is:
[Code]....
and for the view here is the code generated:
[Code]....
the aim here is that i want to add for exampl an other property: [Code]....
I have all the code to save and all the code to validate. My question is will my code in the button(.aspx.vb) validate if my insert command is in the .aspx
I have a form with several DropDownlists and TextBoxes, Each dropdownlist depends on the selection of the previouse one.. and there is a submit button. Once the user clicks on it, information entered by the user is displayed in a GridView and saved as well in the database. The GridView holdes information from two tables I used joining) , but once I click on the Submit button I receive this error: Arithmetic overflow error converting varchar to data type numeric. The statement has been terminated. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Arithmetic overflow error converting varchar to data type numeric. The statement has been terminated. Source Error:
[Code]....
Imports System.Data.SqlClient Imports System.Web.Configuration Partial Class Members_MembersCalculator Inherits System.Web.UI.Page Protected Sub CalculateButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CalculateButton.Click Dim objConnection As SqlConnection Dim objDataCommand As SqlCommand Dim c_manu, c_model, c_date As String Dim sSQL As String Dim ConnectionString As String Dim c_factor As Double Dim c_result As Double Dim c_milage As Double Dim c_id As Integer Dim c_year As Integer c_manu = ManDropDownList.Text c_year = YearDropDownList.Text c_model = ModelDropDownList.Text c_milage = MilageTextBox.Text c_factor = FactorDropDownList.Text c_id = CarIDDropDownList.Text c_date = CarDateTextBox.Text c_result = c_factor * c_milage ConnectionString = WebConfigurationManager.ConnectionStrings("Carbon_free_ConnectionString").ConnectionString objConnection = New SqlConnection(ConnectionString) objConnection.Open() sSQL = "Insert into car (Manufacture, year, Model, car_factor)" & _ "values('" & c_manu & " ', ' " & c_year & " ',' " & c_model & " ', ' " & c_factor & " ')" objDataCommand = New SqlCommand(sSQL, objConnection) objDataCommand.ExecuteNonQuery() objConnection.Close() objConnection = New SqlConnection(ConnectionString) objConnection.Open() sSQL = "Insert into car_Result (car_id, car_Result_Date, Car_result)" & _ "values('" & c_id & " ', ' " & c_date & " ',' " & c_result & " ')" objDataCommand = New SqlCommand(sSQL, objConnection) objDataCommand.ExecuteNonQuery() objConnection.Close() msgLabel.Text = "Your records have been calculated successfuly, Thank you." 'CarDateTextBox.Text = "" 'MilageTextBox.Text = "" CarGridSqlDataSource.DataBind() CarGridView.DataBind() End Sub End Class
My page (which basically contains a pair of Repeaters) renders and is displayed to the user.I'd like to have a "Download" button on the page which, when clicked, will propmt the user to save the page locally as an html file without losing any of the CSS formatting.
My CSS files are linked to via a Master Page.Currently, I have the button linked to some javascript that open will the Save As dialog, but all of the CSS formatting is lost, and it saves the page .I'm assuming that the button will need to open a new page which will re-create the data for the Repeaters and then save using StreamWriter, but I'm not exactly sure if that's right or how best to do it.
one button i use to save form entity.and other is to navigate to next pagwhen i click on save button i use jquery to save form entity in database. and form remains as it is
i have place some .txt files in my web application root directory. now i want to open a popup on button click with save button so that client can save this file on his/her PC. also can we auto set the path??? mean client jst press save button and file automatically stored his "D:\Foldersample.txt".
I have one AsyncFileUpload control ,one Attach button,one Listbox and Save button.
When Users browse the file and click the attach button, filename must be added to listbox. So in this way the user has the option to add upto multiple filenames to listbox. For this i have written the following code
[Code]....
this is source code
[Code]....
In Attach button click event i added the filename to listbox and saved the Asyncfileupload controls in different session variable.
When user clicks on save button all files has to be saved in application folder and for this i wrote the following code.
[Code]....
But iam unable to save all the files . Suppose i added two AsyncFileupload controls to session variables, only last file i,e. 2nd file can only be saved and couldn't get first file.
fileName is the name of the file ending with the file extension (.pgn). However, the file is saved as a .txt file, ignoring the extension that I am giving it. Would this have to do with the Response.Contenttype = "text/plain"? How can I get the Open/Save dialog to display and save the correct (.pgn) filename?
Also, if filename is a string separated by dashes or spaces, when the Open/Save dialog comes up, the filename is not displayed in its entirety but it is truncated where the first dash (-) or space (or comma) is encountered. How can this be remedied?
I am creating the user ,using asp.net + C#.there is the form (UI) who collects the information and send data to Business layer. now, while collecting the information from UI I want to also save the image of user, at file system in application domain.There is function in the business layer as SaveImage, which returns the path where it is saving. Scenario:1) Save image first and then save other information in DB.
am using a master page for my menu.i had placed a literal there.i stored a token in that literal.but on change of menu item...the literal text get cleared.....i want the value in server side
What kind of path would I use to save a file (.pdf) on another server/network drive? Say I have rights to a network drive 'optamail1' and a folder there called datasheets. I can access this folder from "Run" using \optamail1datasheets, however, this kind of path will not work in my application. Has anyone tried doing this before?
I'm building an asp.net mvc application. I have to make posible automatic printing of some documents. I'm wondering where should I save this documents. If I save them to a folder in solution will they be accessible when application is deployed on server? I'm planning on build console application that will be triggered at particular time from windows service and load documents that are saved in that folder and print them one by one.
I have to create an excel sheet by reading data from the database and save this newly created excel to the server. I know how to create the excel, i do it by creating html table then changing the content header. But how can i save this as an excel file in the server.