Click here to Skip to main content
15,893,564 members

Comments by KrishanuDey (Top 5 by date)

KrishanuDey 14-Jan-13 22:43pm View    
Well, I tried your solution. But I got an error saying "Incorrect syntax near 'OUTPUT'." Here is my code..


Dim conn As New SqlConnection(WebConfigurationManager.ConnectionStrings("connectionstring").ConnectionString)
Dim sqlcommand As New SqlCommand
sqlcommand.CommandType = Data.CommandType.Text
sqlcommand.CommandText = "insert into [Customers] (CompanyName,RegistrantName,AddressLine1,AddressLine2,City,State,Country,Zip,PhoneNo,MobileNo,FaxNo,Website,Email) values(@CompanyName,@RegistrantName,@AddressLine1,@AddressLine2,@City,@State,@Country,@Zip,@PhoneNo,@MobileNo,@FaxNo,@Website,@Email) OUTPUT inserted.CustomersID INTO @CustomersID"
sqlcommand.Parameters.AddWithValue("@CompanyName", _Company)
sqlcommand.Parameters.AddWithValue("@RegistrantName", _Name)
sqlcommand.Parameters.AddWithValue("@AddressLine1", _Address1)
sqlcommand.Parameters.AddWithValue("@AddressLine2", _Address2)
sqlcommand.Parameters.AddWithValue("@City", _City)
sqlcommand.Parameters.AddWithValue("@State", _State)
sqlcommand.Parameters.AddWithValue("@Country", _Country)
sqlcommand.Parameters.AddWithValue("@Zip", _Zip)
sqlcommand.Parameters.AddWithValue("@PhoneNo", _PhoneNo)
sqlcommand.Parameters.AddWithValue("@MobileNo", _Mobile)
sqlcommand.Parameters.AddWithValue("@FaxNo", _FaxNo)
sqlcommand.Parameters.AddWithValue("@Website", _Website)
sqlcommand.Parameters.AddWithValue("@Email", _Registration_Email)
Dim paramCustomersID As New SqlParameter("@CustomersID", Data.SqlDbType.UniqueIdentifier)
sqlcommand.Parameters.Add(paramCustomersID)
sqlcommand.Connection = conn
If conn.State = Data.ConnectionState.Closed Then conn.Open()
If sqlcommand.ExecuteNonQuery() > 0 Then
Save = True
_CustomerID = paramCustomersID.Value.ToString()
End If
KrishanuDey 12-Jan-13 7:42am View    
is there any way to use the output clause in vb.net
KrishanuDey 3-Jan-13 14:20pm View    
when i change the connection string name from "LocalSqlServer" to "myCon" and also change the profile provider's "connectionStringName" attribute to "myCon", an error is encountered. It's saying "The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty."
KrishanuDey 22-Dec-12 17:02pm View    
Ahh.. Just tested if is used when saving as a filtered html and found that it is not used while saving as a filtered html. Is there any other way to do the same?
KrishanuDey 22-Dec-12 16:42pm View    
Yes I can set the pixel per inch setting in word 2010 from file->options->advanced->under the section "image size and quality",