|
I think Chris ment not using some third-party mailserver. For example you can use Gmail mailserver with your mail account, but in that case, the "From" of the email will always be the address corresponding to the account used. Basically it all depends on the mail server configuration.
|
|
|
|
|
hi,
add the following line in design mode and check.....it should work
<asp:HyperLink id="HyperLink1" NavigateUrl="mailto:admin@clientdomain.com" Runat="server">Contact us</asp:HyperLink>
and you should be sending the mails through your own mail server.
Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|
|
Hi friends,
Please explain about object pooling with example.
Thanks in Advance,
Regards,
Prya
|
|
|
|
|
|
how to implement stored procedures with outputparameters in asp.net
|
|
|
|
|
The same way you do it outside ASP.NET. ASP.NET is irrelevant.
You specify parameters as output parameters when you add them, and check their value on return.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
u can use this as an example which returns integer as output value
Public Function GetMailSent(ByVal CaseId As String) As Integer
Dim objConn As New SqlConnection
Dim objDB As New clsCommon
Dim objDS As New DataSet
Dim objCommand As New SqlCommand
Dim objDA As New SqlDataAdapter
Dim param As New SqlParameter
Dim intMailSent As Integer
Try
objConn = objDB.GetDatabaseConnection
objCommand.CommandType = CommandType.StoredProcedure
objCommand.CommandText = "spGetMailSent"
objCommand.Connection = objConn
objDA.SelectCommand = objCommand
objCommand.Parameters.Add("@CaseID", SqlDbType.VarChar).Value = IIf(IsDBNull(CaseId), DBNull.Value, CaseId)
param = objCommand.Parameters.Add("@retval", SqlDbType.Int)
param.Value = Decimal.Zero
param.Direction = ParameterDirection.Output
intMailSent = objCommand.ExecuteNonQuery()
GetMailSent = objCommand.Parameters("@retval").Value
Finally
'objDB.CloseDatabaseConnection()
End Try
End Function
Regards,
Ritika
|
|
|
|
|
I have 1 query in which i want to select max(column) value
and second query select * from tablename
i want to bind both these queries to dataset and display in 1 datagrid.
How to do this?
Thanx
Mini Thomas
|
|
|
|
|
Try using group by in query.
SELECT stateid, MAX(stateid) as "MAX id"
FROM states
GROUP BY stateid
Regards,
Saqib Umar
Sr. Software Engineer
|
|
|
|
|
hi toall
I have to populate some datas from sql server database and display it directly in a TEXT Format or TEXT file. When i run the project it should provide me an option to whether open or save or cancel the file. when i click open it should be opened and be viewed in a excel sheet in TEXT format and when i click save it should ask the destination folder and should be saved there in TEXT format and when i click cancel it should be cancelled and the application should be closed. pls note that all these actions should happen in the same browser and should not be redirected to anyother page. Can anybody give me the detailed description and code in Asp.Net using C# .It's very Urgent.
regards
saravanan
|
|
|
|
|
The first step is probably to write a method that returns your data as a CSV, given that this is a good way of getting Excel to read something. So, read your file from the database, iterate over the rows and create your text file. Clicking Save can just feed the file down again to a file.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Every one,
i am trying to use style sheet in content page which is using my master page...
it is not applying syles to Grid..
i declared <link> tag for style sheet... in Master page could u please answer my question
Thanks
Satish
|
|
|
|
|
If master page contains the style definition for the grid in app_theme folder then your style defined in page can't take precedence over skin/style in theme folder.
You can apply a theme as a style sheet theme by setting the page's StyleSheetTheme property. In this case, local page settings take precedence over those defined in the theme when the setting is defined in both places. This is the model used by cascading style sheets. You might apply a theme as a style sheet theme if you want to be able to set the properties of individual controls on the page while still applying a theme for an overall look.
You can add one or more .css files into a theme directory. ASP.NET will automatically apply all of a theme’s style sheets into a page by injecting a element for each .css into the header of a page. Your page must have runat=”server” in the <head%gt; tag="" for="" the="" automatic="" style="" sheet="" inclusion.=""
<div="" class="ForumSig">Regards,
Saqib Umar
Sr. Software Engineer
|
|
|
|
|
Hi Saqib,
thanxs for your reply...
can you please help me how to use ancher <a> Tab and Script tags <script> in content page
regards
Satish
|
|
|
|
|
is there a way to directly export SQL data to excel using a aspx page without displaying this data on a datagrid. so this is not like exporting from datagrid to excel but it is like...when user clicks a button then an Sproc is executed and data should be directly saved into excel. any help would be appreciated,thanks
|
|
|
|
|
Yes you can export data directly from SQL to xls file without displaying it in grid.
Excel can be treated as SQL using connection string like following :
"Driver={Microsoft Excel Driver (*.xls)};DriverId=790;DBQ=/book1.xls;UID=admin;"
rows and colums are treated as html and or .
I've done this work 3 years back on classic ASP.
Don't get confused by the syntax.
Cheers!
Regards,
Saqib Umar
Sr. Software Engineer
|
|
|
|
|
I'm trying, but while the server in VS2005 works fine, IIS7 gives me this error:
HTTP Error 500.19 - Internal Server Error
Description: The requested page cannot be accessed because the related configuration data for the page is invalid.
Error Code: 0x80070005
Notification: BeginRequest
Module: IIS Web Core
Requested URL: http://localhost:80/
Physical Path: D:\inetpub\
Logon User: Not yet determined
Logon Method: Not yet determined
Handler: Not yet determined
Config Error: Cannot read configuration file
Config File: \\?\D:\inetpub\web.config
Config Source: -1:
0:
More Information... This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
--------------------------------------------------------------------------------
Now, the control panel applet initially told me that some fields were invalid, but even getting it to a state where that would work, doesn't fix this. Also went and made sure teh ASPNET user had access to the file. Anyone have any experience here ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian,
Could it be that with "Error Code: 0x80070005" that you are not logged in as Administrator? or perhaps permissions are incorrect?
modified 1-Aug-19 21:02pm.
|
|
|
|
|
No, I'm logged in as admin. I've also gone and given everyone in the entire world access to that file, to see if it's a permissions issue.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Have you already modified the web.config file required by IIS7. Does the web.config file show any errors when it is opened with VS. I suspect it can be as simple as tag not being closed.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
|
|
|
|
|
The file is valid XML, it works with the VS2005 web server, and IIS in XP.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Does it have system.webserver section? Which you are prompted to add when running the app under IIS7 for the first time.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
|
|
|
|
|
No - I'll google that. Thanks.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I have written the code to export the gridview values to Excel, the main problem i am facing is that i have a column in which there is picture which is not shown in Excel.
It showz the general icon of picture not found.
Please Help.
Thanks and Regards,
Deepak Surana
|
|
|
|
|
im having a problem writing values back to the database. im using sql 2000. the values are pulled in from a datagrid the user can make multiple edits and get click a button that preforms a batch update.
below is the code for the button
Protected
Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim txtPrelimDecisionCode, txtPrelimLetterIssued, txtFinalDecisionCode, txtFinalLetterIssued As TextBox
Dim studentId, classId As Label
Dim gvRow As GridViewRow
Dim sqlConn As New SqlConnection
Dim sqlComm As New SqlCommand
Dim sqlDr As SqlDataReader
sqlConn.ConnectionString = (
"data source=.; integrated security= true; initial catalog=dbStudentRecords;")
Try
sqlConn.Open()
sqlComm.Connection = sqlConn
sqlComm.CommandText =
"SELECT * FROM tblStudentDecision"
sqlDr = sqlComm.ExecuteReader
For Each gvRow In Me.dgResults.Rows
' obtain the values from the dataGrid
studentId =
CType(gvRow.Cells(0).FindControl("studentId"), Label)
classId =
CType(gvRow.Cells(1).FindControl("classId"), Label)
txtPrelimDecisionCode =
CType(gvRow.Cells(21).FindControl("txtprelimDecisionCode"), TextBox)
txtPrelimLetterIssued =
CType(gvRow.Cells(21).FindControl("txtPrelimLetterIssued"), TextBox)
txtFinalDecisionCode =
CType(gvRow.Cells(21).FindControl("txtFinalDecisionCode"), TextBox)
txtFinalLetterIssued =
CType(gvRow.Cells(21).FindControl("txtFinalLetterIssued"), TextBox)
'convert the dataGrid Values into the correct data types(not sure if i need this)
'Dim classIdValue As Integer = Convert.ToInt32(classId)
'Dim prelimDecisionCodeValue As Integer = Convert.ToInt32(txtPrelimDecisionCode)
'Dim prelimLetterIssuedValue As Boolean = Convert.ToBoolean(txtPrelimLetterIssued)
'Dim finalDecisionCodeValue As Integer = Convert.ToInt32(txtFinalDecisionCode)
'Dim finalLetterIssuedValue As Boolean = Convert.ToBoolean(txtFinalLetterIssued)
'values from dataGrid
'these values below are printing to the debug just fine
Debug.Print(studentId.Text)
Debug.Print(classId.Text)
Debug.Print(txtPrelimDecisionCode.Text)
Debug.Print(txtPrelimLetterIssued.Text)
Debug.Print(txtFinalDecisionCode.Text)
Debug.Print(txtFinalLetterIssued.Text)
sqlDr.Read()
If IsDBNull("StudentId") Then
'studentId = CType(gvRow.Cells(0).FindControl("studentId"), Label)
' if record does not exsist insert all fields- not sure of the syntax
'sqlComm.CommandText = "INSERT NEW RECORD"
'sqlComm.ExecuteNonQuery()
Else
' i want to update txtPrelimDecisionCode txtPrelimLetterIssued txtFinalDecisionCode txtFinalLetterIssued if the record already exsists
' i tried to get it working with the first value txtPrelimDecisionCode and then i was going to proceed with the rest but damm it dosent work!!
sqlComm.CommandText =
"UPDATE tblStudentDecision SET prelimDecisionCode='" & txtPrelimDecisionCode.Text & "' WHERE studentId='" & studentId.Text & "'"
sqlComm.ExecuteNonQuery()
End If
Next
Catch ex As SqlException
Trace.Warn(
"dbError: " & ex.Message)
Catch ex As Exception
Trace.Warn(
"Other error: " & ex.Message)
Finally
sqlConn.Close()
End Try
End Sub
i thought this would be straight forward but i seem to be having problems any help would be great!
steve
|
|
|
|