|
Did you tried to get what is in InnerText, before assining a value, the problem coud be before assaining value. Note that i can't try, because i dont have accsess to my pc.
Did you checked you gave app.config write permision?
|
|
|
|
|
I am trying to post information from a form to a database but i keep getting the following error:
ADODB.Recorset: The connection cannot be used to perform this operation. It is either closed or invalid
error on line 9.
heres the code
<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("guestbook.mdb")
objConn.Open
DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
'objRS.Open "tblusers", adLockOptimistic, adCmdTable
objRS.AddNew
objRS("Email") = Request.Form("Email")
objRS("Name") = Request.Form("Name")
objRS("Comments") = Request.Form("Comments")
objRS.Update
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<%
DIM strName
strName = Request.Form("Name")
Response.Write strName
%>,
|
|
|
|
|
solarthur01 wrote: The connection cannot be used to perform this operation. It is either closed or invalid
solarthur01 wrote: 'objRS.Open "tblusers", adLockOptimistic, adCmdTable
you've commented out the line that opens the recordset - does the error make more sense now?
|
|
|
|
|
i commented it because it came up with another error : ADODB.recordset arguements are of the wrong type, are out of acceptable range, or are in conflict with one another. Any ideas???
|
|
|
|
|
You haven't told the recordset to use the connection you've just opened...
|
|
|
|
|
is that not the adoCon.Open??? i thought i did that??
|
|
|
|
|
Yep, you opened a connection and then tried to open a recordset but you didn't associate the connection with the recordset. I forget the asp syntax off the top of my head.
|
|
|
|
|
so how can i correct that???do you know the syntax i can put in or where i can get from???thanks mate
|
|
|
|
|
objRS.Open "tblusers",objConn, adLockOptimistic, adCmdTable
this shud be the way to open the Recordset.ie the second parameter shud be the conenction object rather tan Locktype etc.
by the way u shud use an open sqwl statement other than the tblUsers in open statement ok.
Regards
Sean
http://www.codepal.co.nr
|
|
|
|
|
Hi,
I have a ContentPlaceHolder that is in a masterpage. I have a drop down in my masterpage, and this I am using to try and change certain details in the page(contentplaceholder). My issue is that when the dropdown's selected index event causes the postback (event in master page), it goes into the placeholder code first, before moving out into the masterpage, which seems highly incorrect to me 0_o.
any help on this would be greatly appreciated.
|
|
|
|
|
My sugesstion is to put the code in the content page (since you are trying to change the content page) and add a handler for the dropdownlist's event in the content page.
<br />
<br />
protected void Page_Init(object sender, EventArgs e)<br />
{<br />
DropDownList ddl = (DropDownList)this.Master.FindControl("DropDownList1");<br />
ddl.SelectedIndexChanged += new EventHandler(DropDownList1_SelectedIndexChanged);<br />
}<br />
<br />
<br />
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
<br />
I didn't get any requirements for the signature
|
|
|
|
|
thank you very much it works hundreds ^^. I've also used an AJAX Update Panel that effectively Fires the event first, then carries on. I'm wondering which would perform better though =/. curse my curiousity.
|
|
|
|
|
I am encountering a really horrendous bug in ASP.NET session. I would like to give a brief step-by-step on what I am doing.
1) An HttpHandler/Module is involved from an IFRAME to do some important and long-running activity.
2) To keep a COM ISAPI authentication software and ASP.NET also aware that there is a genuine request being processed and the user should not be kicked out, we have another IFRAME to ping a dummy .ASPX page periodically using a META Refresh tag.. We chose an ASPX page so that both the COM ISAPI and ASP.NET would get satisfied by validity of the requests.
3) The Web.config directs SessionState to be SQL Server and is configured with an expiration of 20 minutes. [It has been ensured that SQLServer Table keeps getting new values on every hit of the dummy ASPX page.]
Inspite of actions taken in (3), ASP.NET keeps forgetting the following values on the 21st minutes:
1) A few or all of the Session variables.
2) A few variables used in the HttpModule are NULLed. [They are in use. So I don't think how does GC get an indication to sneak in to gobble them]
Can somebody point out where is the mess up happening on why ASP.NET is forgetting session variables? I would like to add on that there are no recycling of worker process too.
|
|
|
|
|
Just taking a stab here, but make sure all the caching is turned off for the dummy.aspx page. I have a feeling you might be getting a cached version and not satisfying the needs of the session.
|
|
|
|
|
Hi this is my first post. I am working on image in ASP.Net and save to MS SQL.
I got success full to convert the image to byte and save to DB. But how can I get back that image
And display it to .aspx . I am also enable to Convert System.Web.UI.WebControls.Image to
System.Drawing.Image .
Please suggest me if u know about it.
Thanks
Akshay Kumar Saxena
akki
|
|
|
|
|
Read the image value to a byte array. Set the response content type to something like Response.ContentType = "image/gif"; Use Response.BinaryWrite(byte[]) to send this to response.
|
|
|
|
|
i have one popup page with two text boxes by writting winow.return two times i want to pass the textboxes values .how i can hold these values separetly in main page
|
|
|
|
|
u mean to say u want to send the values from popup page to main page...
Regards
Aavesh
|
|
|
|
|
yes sir i have send row value and a column value means to values to main page throug pop up or a show model dialog and how to hold these two values in master page
|
|
|
|
|
You can do it two ways:
1. return the both values separated by some special character like |-| and then split it in the parent page.
2. you can set the field of the parent window from within the modal dialog box like:
top.opener.document.getElementById('field1').value = field1;
top.opener.document.getElementById('field2').value = field2;
-----
|
|
|
|
|
thanks u sir now i used the first one of which u sent .its working now.sir how i can get the iframe source code with html starting and ending tags in another page
|
|
|
|
|
In the declarative catalog part i have a image control. When i add the image in webpartzone in the catalog displaymode at runtime, The image control is displayed without the image.
Similarly in dropdownlist, the list items are not displaying.
You can't do everything...
But you can do something...
So never refuse to do something that you can.....
|
|
|
|
|
Hi the follwoing coding i used for my menu controls...,
This things i have already said in my backend code part...,
Suppose this headings and subtabs and that links are coming from database...,
How to mention that one here?????,
It means the the main menu its contained submenu and while clicking that that sub menu transfer to that url all from my table way...,
How to do that?,
Plz help me,
'Adding here main tabs
Dim _Text As ArrayList = New ArrayList
_Text.Add("Admin")
_Text.Add("Guest")
Dim ts As JQD.TabStrip = CType(Me.FindControl("TabStrip1"), JQD.TabStrip)
ts.TabText = _Text
Dim _SubTabText As Hashtable = New Hashtable
'Adding here Sub tabs for that Admin (main) tab
_Text = New ArrayList
_Text.Add("Admin User Login")
_Text.Add("Admin Default Page")
_SubTabText.Add(0, _Text)
'Adding here Sub tabs for that Guest (main) tab
_Text = New ArrayList
_Text.Add("microsoft")
_Text.Add("oracle")
_SubTabText.Add(1, _Text)
ts.SubTabTextCol = _SubTabText
AddHandler ts.SelectionChanged, AddressOf Me.ts_SelectionChanged
Private Sub ts_SelectionChanged(ByVal sender As Object, ByVal e As JQD.TabStrip.SelectionChangedEventArgs)
'Assigning links for that sub tabs
Dim TabPos As Integer = e.TabPosition
Dim SubPos As Integer = e.SubTabPosition
Select Case (TabPos)
Case 0
If (SubPos = 0) Then
src = "Admin1.aspx"
End If
If (SubPos = 1) Then
src = "Admin2.aspx"
End If
Case 1
If (SubPos = 0) Then
src = "Guest1.aspx"
End If
If (SubPos = 1) Then
src = "Guest2.aspx"
End If
End Select
Session("src") = src
End Sub
Regards,
Magi
|
|
|
|
|
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
MailMessage message = new MailMessage(txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text);
SmtpClient emailClient = new SmtpClient(txtSMTPServer.Text);
System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential(txtSMTPUser.Text, txtSMTPPass.Text);
emailClient.UseDefaultCredentials = false;
emailClient.Credentials = SMTPUserInfo;
emailClient.Send(message);
litStatus.Text = "Message Sent";
}
catch (Exception ex)
{
litStatus.Text=ex.ToString();
}
}
i have used this code for sending email to other..
there is a window page and there are many textboxes for them,
for this code i can use my yahoo a/c "from" field. and what i can use in fields SMTPserver,SMTPuser and SMTPpass.
plz helpp me sir
yogesh
|
|
|
|
|
yogesh_softworld123 wrote: for this code i can use my yahoo a/c "from" field. and what i can use in fields SMTPserver,SMTPuser and SMTPpass.
Yahoo won't allow you to use their SMTP server for free. You try Gmail. They allow to do so. check this http://www.codeproject.com/useritems/smtpmail.asp[^]
|
|
|
|