|
in my project i have a class which has some shared methods and ENUMs. Its work when developing but at web servwer it doesnt. that class stands in APP_CODE folder.
What ca i do?
|
|
|
|
|
greekius@hotmail.com wrote:
but at web servwer it doesnt. that class stands in APP_CODE folder.
What error you are getting ? ASP.NET treats APP_CODE as a single assembly. Post sample code where you are getting error.
|
|
|
|
|
Hi,
I'm having a problem selecting records from my database to display on the web page. I want to select all records with a specific name, and on a specific date. The code I'm using looks like this:
<br />
StrConnect = Server.MapPath("./MyDataBase.mdb")<br />
cn = Server.CreateObject("ADODB.Connection")<br />
cn.Open("PROVIDER=MICROSOFT.JET.OLEDB.4.0;Data Source =" & StrConnect)<br />
rs = Server.CreateObject("ADODB.Recordset")<br />
rs.Open("SELECT * FROM TheLog WHERE name='123' AND recdate=#01/02/2003#", cn, 3)<br />
Now despite there being about 5 records with that name and date, I don't get any records returned.
Does anyone know why?
P.S. The database is a Access database, the name field is set to "Text" and the recdate field is set to "Date/Time"
- Munty
|
|
|
|
|
Try using a range of dates (eg. between 01/02/2003 00:00:00 and 01/02/2003 23:59:59, don't use my syntax ) rather than specifying recdate to be exactly equal to 01/02/2003
_______________________________________________________________________
http://www.readytogiveup.com/[ ^]
"you can't forget something you never knew..." M. Du Toit
|
|
|
|
|
Nope, didn't work.
:/
The string I used was:
SELECT * FROM TheLog WHERE name='123' AND recdate BETWEEN #01/02/2003 00:00:00# AND #01/02/2003 23:59:59#
Also,just to note, when I ouput the date field to a text box, I get:
01/02/2003
- Munty
|
|
|
|
|
name is reserved word in TSQL
Muntyness wrote: WHERE name='123'
and you try this
"SELECT * FROM TheLog WHERE [name]='123' AND recdate=#01/02/2003#"
I Love SQL
|
|
|
|
|
Name is reserved? Bah.
Well I've changed the field to Job now. and I've tried both:
"SELECT * FROM TheLog WHERE job='123' AND recdate=#01/02/2003#"
And
"SELECT * FROM TheLog WHERE [job]='123' AND recdate=#01/02/2003#"
Neither of them work.
This does work however:
"SELECT * FROM TheLog WHERE job='123'"
- Munty
|
|
|
|
|
Hi,
This may be a stupid question, but I'm having troubles assigning a hex value to the backcolor of a table cell with code.
I'm currently adding values into a table with code, but I would like to change the back color by giving the color's hex code or #code.
In the visual designer I can easily add the hex code, why not with code or am I forced to split it into blue, red and green or just use the basic system.drawing.color choices?
Hope someone can help
Kind regards
|
|
|
|
|
You create a Color value using the FromArgb method:
SomeTableCell.BackColor = Color.FromArgb(0xffff00); // yellow
or
SomeTableCell.BackColor = Color.FromArgb(0x80, 0x80, 0x80); // grey
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you, it works.
I just had to use '&H' instead of '0x' for VB.
But it works great, thank you for the help
|
|
|
|
|
Hi all,
I'm loading the meta tag values form the database for the description and the keywords, but its not doing what I want it to.
Currently I have the following
<meta name="keywords" content="<%=Keywords %>" />
Keywords being a property in codebehind, but if I view the source of the page when I run it, it displays the content of the tag as follows & lt%=Keywords %& lt
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
You can use the headers property of the page to add information to meta tags, for example
Dim meta as new HtmlMeta()
meta.Keywords = "test, stuff"
Header.Controls.Add(meta)
Try taking a look at that and if you get any problems post back
|
|
|
|
|
Thanks for the reply, What I did was added the runat attr to the meta tag, and then in the code behind I just used metaId.Content and assign the property to that
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
You can try it using a method that returns the keyword.
<meta name="keywords" content="<%=GetKeywords() %>">
public string GetKey()
{
return keywords;
}
|
|
|
|
|
Hi there,
I've got a TreeView like below
1
1.1
1.2
1.2.1
1.2.2
1.2.3
1.3
2
The code in SelectedIndexChange event like below
TreeNode currentNode = TreeView1.SelectedNode;<br />
TreeNode parentNode = currentNode.Parent;<br />
<br />
currentNode.Select();<br />
<br />
if (parentNode != null)<br />
{<br />
Response.Write(parentNode.ChildNodes.IndexOf(currentNode));<br />
}<br />
else<br />
Response.Write(TreeView1.Nodes.IndexOf(currentNode));
If I clicked 1.2.1 or 1.2.2. or 1.2.3, the page would say the index of the node I've cliked right.
If I clicked 1 or 1.1 or 1.2 or 1.3 or 2, the page would say the index of the node I've clicked is 0.
I don't know why, the index of 2 should be 1, index of 1.3 should be 2, ... but it wasn't correctly.
Anyone help me solve this issue.
Thanks.
|
|
|
|
|
|
I think you are looking for the documents tab in the IIS manager. This is where you set the start page of your site. It usually defaults to default.htm. So whatever you want your start page to be, you need to add it and put it at the top of the documents.
Hope that helps.
Ben
|
|
|
|
|
i solved, not enought to prohibit VS 1.1
I also changed file extensions compability from Configuration menu at properties of default web site.
|
|
|
|
|
I am using datatable in my application to show the data in gridview.Now what I want is that when user enter a new line application should check the datatable.if the record exists then it should show a warning otherwise add a new row in datatable.
I am using the following code to check the datatable through loop.
Dim x As DataRow
For Each x In mydatatable.Rows
If x.Item(1).ToString = Me.TextBox1.Text Then
Me.Label1.Text = "Exist"
End If
Next
With the above code I am getting error 'Object reference not set to an instance of an object.' at the first row of the for loop
Ejaz
|
|
|
|
|
Wow - TextBox1 and Label1 are variables in production code ? That's pretty grim.
Please don't crosspost. Where you asked in the VB.NET forum is probably the best place for this, as it doesn't directly involve ASP.NET.
Obviously you have a Row which doesn't have 2 items in it. It's always good practice to test your assumptions, as in
if x.Items.Count > 1 && x.Item(1).ToString = Me.TextBox1.Text Then
something like that.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I wrote code in the Application_End and Session_End in the Global.asax file
but i don't know how to invoke this code
i close the page and none of the 2 methods are invoked
|
|
|
|
|
Session_End --
closing the page doesn't end the session. Even after closing the browser window session can be still active till the session time-out is reached.
Application_End --
application ends when the web-server is stopped or restarted or web.config file is updated/changed.
Regards
John
|
|
|
|
|
can someone please help me. I've gotten all my code to work but my actual delete part. I've tried to fix it but i can't seem to fix the problem what i do just doesn't make any difference.
the code is:
<%
dim strSQL
if request.QueryString("ProductID")="" then
dim rs
set rs=server.CreateObject("ADODB.Recordset")
strSQL="SELECT * FROM Products"
rs.Open strSQL, oConn
response.Write("")
while not rs.EOF
response.Write("")
response.Write("")
response.Write("")
rs.MoveNext
response.Write("")
wend
response.Write("" & rs("ProductID") & " | " & rs("ProductName") & " | " & rs("SupplierID") & " | " & formatcurrency(rs("UnitPrice"),2) & " | Delete | ")
rs.Close
else
//the problem is below somewhere
strSQL="DELETE FROM Products WHERE ProductID=" & request.QueryString("ProductID")
oconn.execute strSQL //the error message says this part
response.Redirect("DeleteProduct.asp")
end if
oconn.close
%>
thanks
Robbie
|
|
|
|
|
well, what is the error message you're getting ? That might help....
Is this an Access db? I can't remember, it's been so long since I used Access, but don't you have to say "delete * from..." in Access, not just "delete from..." ? I could be wrong on that...
|
|
|
|
|
This is ASP code, as you said. This is the ASP.NET forum, the Web Dev forum is a better place to ask this.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|