G_Waddell 131 Posting Whiz in Training

Hi
You will need to use office automation or the likes, it is not as simple as as text file where you append lines of plain unformatted text.

You may have to create a new blank word doc and populate it with the source of the other two.

Try starting here: http://support.microsoft.com/kb/316383

G_Waddell 131 Posting Whiz in Training

Hi
As well as using parameters, I'd limit the size of text that can be put in to the textbox. I'd also either parse the text for and characters you'd expect to see in a SQL injection attack such as the sql delimiter ";" and reject or replace them with empty characters.

Finally on the database (if you are using MS SQL server,) I would give the user you are using to connect to the database from the website no permissions on any tables at all and run all queries through stored procedures with permission to access them only. This means that even if the injection attack were to get to your database the statement would and could not be executed.

G_Waddell 131 Posting Whiz in Training

GW,

I don't know much about ASP.net but I'm pretty sure that forcing the login page to be displayed will not in itself cause a session to be terminated. Unless the login page's ASP script included a deliberate session-killer, the user could simply press the browser's back button and carry on. Besides, you would give yourself a headache resetting the timer at each user interaction.

As with other server-side environments, I think you need to control session timeouts server-side not client-side. This article discusses the options:

http://justgeeks.blogspot.com/2008/07/aspnet-session-timeouts.html

And I'm sure much more advice is available on the web.

With a server-side approach, requests that naturally arise during a session will (subject to server-side settings) keep a session alive.

It's hard to think of an example but in web applications that give rise to only infrequent requests, and for which a session timeout is considered necessary, Javascript might be employed to make "keep-alive" requests. It is thus more realistic for a client-side script to keep a session alive than to kill it.

Airshow

Sorry, you are misunderstanding my issue.

I have the server settings resetting sessions after 20 minutes of inactivity, the Javascript clientside code redirects the page to the login after 20 mins and 500 milliseconds so the session has already been killed off at that point. If they try and hit the back button, the page will not find the session variable that says they've logged in and will redirect to the login page. …

G_Waddell 131 Posting Whiz in Training

Hi All,

I have to deliver a secure web ASP.net site that after 20 minutes of inactivity wipes the users sessions and forces then to login again. I have set up all the necessary timeouts on the server and at the top of each of my master pages I have placed the following javascript:

setTimeout('top.location = "login.aspx"', 1200500)

The idea being that once the server has expired the session at 20mins of inactivity the browser will load in the login page. This works great until I use AJAX on my pages I suspect that as the page is only doing a partial reload, the timer keeps running as it were.

My questions are:

  1. Am I correct?
  2. Is there a way to reset the Client side timer through AJAX?

Any help much appreciated.

G_Waddell 131 Posting Whiz in Training

Hi,

I would not do it that way, you are taking a round trip to the server to check if something has been filled in then trying to close the browser window if it hasn't?

Or is it a security feature? In which case, if they haven't logged in why not simply use Response.redirect to put them onto your login page...

G_Waddell 131 Posting Whiz in Training

Hi,

Not sure what you mean

sub CancelButtononclick()
Mydropdownlist.items.clear
Mydropdownlist.visible =false
end sub

sub loadbuttonClick()
Dim it As Integer
For it = 0 To 1000000
DropDownList1.Items.Add(it)
Next
ENd Sub
G_Waddell 131 Posting Whiz in Training

Hi,

I'd use one of the many free scren scraper tools there are out there and save myself the bother.... you can get them to export to csv or xml and take the file into read....

G_Waddell 131 Posting Whiz in Training

Okay, you REALLY need to think about your code logically.


What you are doing is this:

1. You have an integer i and an integer a
2. You don’t set any values for i or a
3. You then clear your listview
4. Now you go to point i in moviearray (i=0 because you never gave it a value)( does moviearray exist?)
5. You change the value in moviearray at point i
6. You sort moviearray
7. Now you loop through i =0 to a (which is zero as you never gave it a value)
8. You split out the value of moviearray at i (which will be zero) this makes a new array (movies)
9. You add a new item to listview1 with the value of movies(i) or movies(0)
10. For the listview1.item(i) you add a sub item the value of movies(1)
11. You now increase a to 1 (0+1 =1)
12. You redim movieArray(1)

You are doing this every time you run this routine so you get one list item and one sub list item depending on what you selected.

G_Waddell 131 Posting Whiz in Training

hi,
So when the user selects something you want to add it to the array and then loop through the array and create a new list?

G_Waddell 131 Posting Whiz in Training

thanks codeorder
..hehe..it's already working well..this is my new code

Dim wrkStn As String

wrkStn = String.Concat("lbl", (txtSearch.Text.ToUpper))

        If Not CType(Me.Controls(wrkStn), LinkLabel) Is Nothing Then
            With CType(Me.Controls(wrkStn), LinkLabel)
                .BackColor = Color.Orange
            End With
        End If

Hi,

First of all... Dude I'm at work! a bit of patience or you could pay me €50+K a year plus pension and health benefits and I'll work for you.

Second - my bad, Findcontrol is what you use on webpages -DOH!!

G_Waddell 131 Posting Whiz in Training

thanks dude!
i attached the picture of my project..and that is how it looks like

Looks nice, glad I could help - don't forget to mark as solved....

Also, you may wnt to loop through the individual LinkLabel controls and reset their colours before setting the target one, incase the user has already selected one person then selects another.

G_Waddell 131 Posting Whiz in Training

Hi,

dim MyLabel as linklabel

MyLabel = form1.findcontrol(Textbox1.text)
If MyLabel isnot nothing then
  MyLabel.BackColor = Red
End if
G_Waddell 131 Posting Whiz in Training

Hi,

It could be a permissions error, naturally enough your AD is well protected - i'd never recommend querying it directly from a web page you're better building a comm object or something to do it for you and then just pulling back the data from that.

G_Waddell 131 Posting Whiz in Training

Hi,

If your application pool is recycled then it can affect your sessions, you need to set the application pool recycle on the Application pool that your site is using in IIS - be aware other sites could also be using the same pool, so it maybe worth putting your site in it's own pool before doing this.

You can give the recycle a time out value e.g. after 27 hours recycle the pool or get it to recycle at a set time each day e.g. recycle the pool at 1 am each day.

If I was building something like an intranet where all your users where in a single time zone etc I'd go with the recycle at 1 am approach, if it's a web site where users could be coming in at any hour I'd push the recycle out as far as I could which I think is 27 hours...

G_Waddell 131 Posting Whiz in Training

hi

MyLinklabel.backcolor = red

Here is a link to all the system colours
http://msdn.microsoft.com/en-us/library/system.drawing.color.aspx

G_Waddell 131 Posting Whiz in Training

You can use JOIN keyword to link two or more tables and retrieve data from those tables based on similar columns that exist in those tables or you could make good use of subqueries

Err.... sorry isn't that what I more or less told them....

G_Waddell 131 Posting Whiz in Training

Hi,

Your query has no joins, look up INNER JOIN and OUTER JOIN in Google. Basically JOIN tells your query how to join the tables together - you can do it by the where clause as you have done but something in your query is causing an ambiguous join…

What database are you using? There is a database forum under Web development bizarrely enough, (Maybe this should be out on its own forum?) which has sub areas for the common Database servers.

Hopefully this will get you started on the right path...

G_Waddell 131 Posting Whiz in Training

Hi All,
I have a solution so I thought I'd post in case anyone else has problems with Office 2007 and 2010 files.

Instead of

Response.BinaryWrite(DocStream)

use

Response.OutputStream.Write(DocStream, 0, DocStream.Length-1)

It has been explained to me that because the Office 2010 & 2007 files are now zipped up XML files they can be really fussy about text data appearing after the tags. So you have to be precise about the length of binary data you are sending down to the client. Other file types just get what they need and ignore anything after that but the newer Office documents consider anything extra as incorrectly formed xml code even if it is a zero byte. Which when you think about it makes sense.

G_Waddell 131 Posting Whiz in Training

Anyone???

G_Waddell 131 Posting Whiz in Training

Anyone??

G_Waddell 131 Posting Whiz in Training

Hi

SQL Server supports DatePart so if you are actually storing your dates as date type values then:

SELECT DatePart(month, Mytable.MyDateValue) As TheMonth FROM MyTable

Also I've fairly sure I've seen MONTH() used as well:

SELECT MONTH(MyDate) As TheMonth From MyTable

Both of these will give you an integer e.g. 1 for January etc...
You could then use MonthName in your VB.net to get the actual name...

Note of caution, if you are inputing the date values you should always input them in dd mmmm yyyy or yyyy-mm-dd format this ensures the dates are being stored in the correct format in your DB. i.e. 08/09/2011 to me is the 8th Septemeber (European format) but could be August 9th to someone from the US or server using US formats.

G_Waddell 131 Posting Whiz in Training

Hi

We have two identical web servers in a farm and I need them to be able to share Session variables as I do not know which machine the user will be using at any given time i.e. if a user where to log in to a site on server1 and then post back I cannot 100% guarentee that server 1 will process the request.

I have been looking at sharing session state through SQL but rather than do this on our live servers I set up a pair of VM's on my local machine to test. I have SQL (2005 Developer edition) installed locally on my machine so I decided to use this as my test DB.

On each machine, I posted up a test web site with a default page to enter some text (firstname and lastname) and then store these in a class which I have marked as serializable and store this class in a session variable.

On the Web config of the site(s), I have carried out the following:

  1. Set a common Machine Key to allow session state to be shared accross both servers
  2. set enableViewStateMac to false
  3. Set Session State mode to SQLServer
  4. Added a SQL connection string to my local DB with a specified SQL login
  5. Set Cookieless to use cookies
<machineKey validationKey="#######################" decryptionKey ="~~~~~~~~~~~"  validation="SHA1" decryption="AES" />
<enableViewStateMac ="false" />
<sessionState mode="SQLServer" sqlConnectionString="server=<myServer>;uid=<SQLUser>;pwd=<Password>" cookieless="UseCookies" timeout="20" />

I ran the ASPNet_Regsql.exe on My database server with the -ssadd …

G_Waddell 131 Posting Whiz in Training

Hi

If you are in a loop and want to increase the size of an array by one each time you can use the Ubound value like so
Single dimension array:

Dim MyArray(0)
for i =0 to Mylimit
   redim preserve MyArray(ubound(MyArray)+1) 
'Actually Ubound(Array, Dimension) but by default it is one.
   MyArray(i) = Value(i) 
'for purpose of demo value is some sort of collection you wish to store as an array
next

And Multi Dimensional:

dim MyArray(2,0) 
for i =0 to Mylimit
'because we have a multi dimension array we need to specify the dimension (2) being 
'increased - Note you can only change the size of the outer most dimension 
'while using preserve....
   redim preserve MyArray(2, ubound(MyArray, 2)+1)
   MyArray(0,i) = Value1(i)
   MyArray(1,i) = Value2(i)
   MyArray(2,i) = Value3(i)
'for purpose of demo the values are collections you wish to store as an array
next
G_Waddell 131 Posting Whiz in Training

well, check your code-behind file i:e. the HTML file of the page and get the width of the textbox and make the width of the FileUpload control same with the textbox. You can do this in design time

Thats what I was saying, that does not work as the width specifies both the textbox part and the Button part of the upload control i.e. it is rendered as a single HTML tag:

<input type="file" name="ctl00$BodyContent$FileUpload1" id="BodyContent_FileUpload1" title="Browse to Document" />

I'm trying to get the "text part" to line up with my textbox and the browse button part to be to the right of them... I hate doing it by eye on the design mode as i'd rather be able to give a specific width.

G_Waddell 131 Posting Whiz in Training

Hi
If your using SQL Server you should for security reasons never write your queries on the fly, use stored procedures and give the user only access to excute stored procedures and views.


The good news is you need only write a stored procedure to delete whatever record you pass in as parameters and then just execute it in your code.

G_Waddell 131 Posting Whiz in Training

Hi

WOAWW!! if you want to sych two databases DO NOT USE Auto Numbers for Primary KEYs
Actually do not use Access, SQL Server is far more sophisticated at handling this ( SQL Express is free too)

If you've no choice but to use Access then you will need to assign unique primary keys in your code - no auto numbers

The following example illustrates why:

Two access databases DB1 and DB2 they know nothing about each other...

Each has a table say Customers with an Auto Increment primary key...

DB1 gets a new record and gives it a primary key of 1, DB1 gets an other new record and gives it a primary key of 2. DB2 gets a new record so it's primary key is 1 because DB2 doesn't know about DB1

You go to merge the tables and yikes! duplicate primary keys.... are these old records that need updating or current records from the other DB? You don't know as you just have auto incrementing numbers...

So there are a couple of things you can try:
1. Have a composite Primary key made up of customerNo and DatabaseNo - but then each customer number is not unique...
2. Have a single primary key but encode it yourself so it will be unique to each Database SQL has a special Field type ROWGUID that gives a special ID that I think uses the IP Address of the …

G_Waddell 131 Posting Whiz in Training

Hi
Did you look at page 5? http://www.homeandlearn.co.uk/net/nets12p5.html Thats where they are filling the dataset with the adapter...

G_Waddell 131 Posting Whiz in Training

Hi,

As Debasisdas subtly points out, where do you populate DS?

In your code you've given us so far DS is an unnamed, empty dataset so where is DS.Tables("Employees") coming from? If you haven't populated DS then the DS.Tables collection is empty and you can not add data to a non existant table.

If you have but just haven't shown us the code then how are you doing it? I see you starting to put a command builder together for a dataadaptor but you don't seam to do anything with it....

G_Waddell 131 Posting Whiz in Training

Hi guys,

This one is a bit out of left field but someone somewhere must have tried this before.

Does anyone out there know how to control the width of the filepath textbox in a fileupload control?

I have a form with a comment textbox, a filetype dropdown and a fileupload control

I want the comment textbox, the dropdown and the textbox part of the fileupload to all be the same width and line up together on my form but the width property of the fileupload control sets that of the whole control (Textbox and browse button)

I tried setting the width of the other two controls and lining up that way but:

  1. How do I know that this will look okay in other browsers?
  2. My dropdown looks wierd as it is cutting off text - I'd rather resize the other two controls.
G_Waddell 131 Posting Whiz in Training

Hi,

I got a good free third party tool called Webchart to do this, http://www.carlosag.net/Tools/WebChart/

Before I was looking at trying to embed / use Excel - messy... and requires Excel on your server.

The webchart generates a chart object as a graphic for you so no need of excel etc on server. I use it to populate an ASP.Net Image tag on the fly by setting the source to be a page that takes in values and returns the chart object as a bitmap.

G_Waddell 131 Posting Whiz in Training

Hi,

Are you trying to get the page to validate something else on th form e.g. a textbox before uploading the file?

If so, you do your validation client side that way you will not lose your file path as the form will not be submitted like this:

'on code behind on page load
btnUpload.attributes.add("onclick", "return ValdateForm()")
<!--On Client Side-->
<script language="javascript" type="text/javascript">
function ValdateForm(){
  var txtTextBox = null;
  if(document.getElementById) {
    txtTextBox = document.getElementById("<%=txtTextBox.clientID%>"); 
  }
  else if(document.all) {
   txtTextBox = document.all["<%=txtTextBox.clientID%>"];
  }
  if(txtTextBox.value==null||txtTextbox.value==""){
   alert("Fill me in!");
   return false;
  }
  else {
   return true;
  }
}
</script>

If the Textbox has no value the javascript will return a false and stop the button submitting the form (leaving your filepath in place). If there is a value in the textbox, the javascript returns true, the form submits and eveything goes on as normal.

G_Waddell 131 Posting Whiz in Training

Hi All,

I have a section of my site that allows users to upload and download files.

For security issues, We use a com object to take the file as a binary stream and store it on our network off of the web server (under a different randomly generated file name).

The same com object is used to stream the file back to the user if they open the link to it so they never know where the actual file is stored.

Everything was fine with this until we upgraded to Office 2010 now docx and xlsx files are uploading fine but when they are opened via the web site, a dialog appears telling the user the file has unreadible content and asking if they wish to recover the document.
After saying yes to this the file opens perfectly. Other files .doc .xls .csv .txt etc are all unaffected.

I can open the files directly from the network folder with no issue so I think it is where I am streaming it back to the users browser that is the issue (I'm using VB.net):

sub OpenFile(byref FilePath as string, byref FileName as string)
dim objDocument As Object = CreateObject("DocumentHandler")
dim DocStream() as Byte
If objDocument.CheckDocumentExists(FilePath) then
   'fetch document from network as a byte array
   DocStream = objDocument.FetchDocument(Server.UrlDecode(FilePath))
   'open stream in new container by file name
   Response.Clear()
   Response.ClearHeaders()
   Response.AppendHeader("Content-Disposition", "Attachment; Filename=" & FileName)
   'Write the file directly to the HTTP output stream...
   Response.BinaryWrite(DocStream) …
G_Waddell 131 Posting Whiz in Training

Hi all,
I found it through trial and error.

I added Response.Clear and Response.ClearHeaders before appending my header and it did the trick.

Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)
        Dim o As Object = CreateObject("#######") 'object that brings back stream
        Dim vntStream() As Byte
        Dim CmdArg, CmdName As String
        CmdArg = e.CommandArgument 'fullpath to file 
        CmdName = e.CommandName 'Filename
       'get binary stream
        vntStream = o.FetchDocument(Server.UrlDecode(CmdArg.ToString)) 
        Response.Clear()
        Response.ClearHeaders()
        'Add header - does not seam to be working
        Response.AddHeader("Content-Disposition", "Attachment; Filename=" & CmdName)

        'Write Out Binary stream
        Response.BinaryWrite(vntStream)

        'Finish
        Response.End()

    End Sub
G_Waddell 131 Posting Whiz in Training

Hi

I'm writing a site that allows users to download documents securely stored on the network off of the web server.

I'm using a com object on the server that we've been using here for ages that fetches the file from the network in a binary stream thus preventing user access to the network.

The problem I'm having is when the user clicks on the link, instead of the file opening, the page reloads itself with the stream as its source.

On the open save dialog instead of filename.* I get MyPage.aspx as the file name it is as if my response.AddHeader is not working.

It all works fine on my localbox -it only happens after I publish to a test deployment server.

(This is the first time I've tried this in Visual studio 2010 with .Net framework 4.)


Here is my Page and code:

<!-- inside of a datarepeater....-->

<asp:LinkButton ID="MyLink" runat="server" CommandArgument='<%# Eval("FilePath") %>' CommandName='<%# Eval("FileName") %>' ToolTip="Open File" OnCommand="LinkButton1_Click" CssClass="PrimaryNavigation"><%# Eval("FileName") %></asp:LinkButton>

And here is the code behind:

Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)
        Dim o As Object = CreateObject("#######") 'object that brings back stream
        Dim vntStream() As Byte
        Dim CmdArg, CmdName As String
        CmdArg = e.CommandArgument 'fullpath to file 
        CmdName = e.CommandName 'Filename
       'get binary stream
        vntStream = o.FetchDocument(Server.UrlDecode(CmdArg.ToString)) 
       
        'Add header - does not seam to be working
        Response.AddHeader("Content-Disposition", "Attachment; Filename=" & CmdName)

        'Write Out Binary stream
        Response.BinaryWrite(vntStream)

        'Finish
        Response.End()

    End Sub

Like …

G_Waddell 131 Posting Whiz in Training

Hi

I'll start you off in the right direction, look up the System.IO class

G_Waddell 131 Posting Whiz in Training

look up response.binarywrite

G_Waddell 131 Posting Whiz in Training

Hi

I'm not going to tell you Exactly how to do it (you can research it,) but I'll give you a rough outline:
1. Open/ create a csv file
2. Loop through each row in the datagrid
3. for each cell in each row, add it's value to a comma delimnited string
4. Write this string out as a line of text in your csv file
5. Wipe the string for the next loop
6. Save the Csv file
7. Close the file.

You may want to google/look up the following:
- The Datagrid class,
- The System.IO class

G_Waddell 131 Posting Whiz in Training

Reinstall Visual studio ??

G_Waddell 131 Posting Whiz in Training

hi

mybutton.CommandArguement = mydropdown.selectedvalue
G_Waddell 131 Posting Whiz in Training

Hi,

We use a free object called freetextbox (try googling) it is easy to set up and use (just register the DLL) Only thing is if someone pastes in text from Word you get that horrible Word HTML....

There is tool we now use Editor from Teleriks but although it avoids the word HTML issue it costs money....

G_Waddell 131 Posting Whiz in Training

hi,

Add the following to your page_load event:

Page.MaintainScrollPositionOnPostBack = True
G_Waddell 131 Posting Whiz in Training

Hi
You need to assign user rights on a directory / folder level locally on a machine.
You assign the rights either on an individual level or through a group. If you open windows explorer on a machine and right click a directory, then this will bring up the properties of the directory including Sharing and Read/Write permissions.

G_Waddell 131 Posting Whiz in Training

Hi
Sorry I was on the ASP.Net forum looking at a problem there before I saw this one and I must have still been in "Web Mode".

Are you allowing the user to select the file location through a dialog?

I usually allow the user to select / browse to the destination directory first then do a check that the directory does exist (and if not create it,) and then allow them to input the filename or select the source file that way I know that it is actually going to a location that does exist.

Are the users on Windows 7 machines? I've noticed that by default users only really have write access to their documents folders and you need to give thenm specific permission to write to other folders.

G_Waddell 131 Posting Whiz in Training

Hi
Ever had the situation where you need to make a copy of a Datatable? Or where you wish to copy a datarow from one datatable to another?

Well here is how by using Clone, Copy and the ImportRow DataTable Methods.

G_Waddell 131 Posting Whiz in Training

Hi
One thing I noticed was you commented out the line where you defined dr as as SQLDataReader but I don't see:

dim dr as OleDbDataReader

So how does your code know what dr is supposed to be?

G_Waddell 131 Posting Whiz in Training

Hi
Does the user account the application is running under (you can check and configure this under IIS) have read & write permissions on the directory?

Also is this for an Intranet site or a web site? The reason I'm asking is do you really want to give someone on a website direct access to your file system?

If I need to take files in from the web I don't give anyone access to our file system, I upload them as a binary stream through a com object to a predefined directory not directly on my web server. Once I've ran a virus scan on it, I put it on our network but if the client needs to open it I again use a seperate com object to get the file as a binary stream from the network that way the end user never actually gets on our network or the servers filesystem and doesn't actually know where the files are stored. (As extra security the I store the actual files on the network with a different encoded file name.) In other words, I never just allow the user to upload a file or access an uploaded file without checking it first and then never allow direct access.

G_Waddell 131 Posting Whiz in Training

Hi
I thought I'd share this with you all as it is really quite simple but I spent ages looking for it.

I have an ASP.Net App with a master page containing a tree view that holds a heirarchy of data (as opposed to site naviagation)

What I wanted was when the user clicked on the Tree the postback event for the tree would fire and I could process what node they had clicked (data level, node values, etc.) which I then store in a session variable and then I wanted to reload the current page with this new data as the page was also holding other data specific to the current node in other variables.

i.e. when not post back, the page wipes these variables and populates with whatever is needed for the new node. During post back event from other controls, I want to keep this data and only react to the postback.

So on my

TreeView_SelectedNodeChange

event I processed the node data then finished off with

Response.Redirect(Request.RawUrl)

to reload the page.

However, I was getting errors because although I had changed and wiped the data the actual page was still treating it as a post back and now had orphaned data.

It turns out I was only half way there! All I needed to do was add a flag to my

Response.Redirect(Request.RawUrl)

call which tells the server to stop executing the current page:

Response.Redirect(Request.RawUrl, true)
G_Waddell 131 Posting Whiz in Training

Hi,

You can split out your time and date and just modify the time if you wish. But it looks like the picker is not recognising the date part that you put back in. I'd format the date into serial (yyyy-mm-dd) or extended format (dd MMM yyyy) it avoids confusion over US verses ROW date format (mm/dd/yyyy vs dd/mm/yyyy)

I'd do something like this:

sub SplitDateAndTime(byref Mydate as Date)
dim sDate, sTime as string

sDate = format(datevalue(mydate),"dd MMM yyyy")
textbox1.text = sDate

sTime = TimeValue(mydate)
textbox2.text = sTime
end sub

sub UpdateDate()
dim sDate as string

if isdate(textbox1.text) then
   sDate = textbox1.text &" " &textbox2.text
   TimePicker.value = trim(sDate)
end if
end sub

That should put the date value in the format of something like "30 Mar 2011 10:54:00" depending how you are passing in the time value.

Saikalyankumar commented: Excellent Conclusion +0
G_Waddell 131 Posting Whiz in Training

Hi,

How exactly are you modifying the DateTime? Are you using DateAdd or are you just changing the time "manually".

It looks to me that either the modified date is in a format that the datetime picker can't understand and it is defaulting to January 1 1900. Or that your code is not adding time to the date properly.

G_Waddell 131 Posting Whiz in Training

Hi All,
I'm working on a web app in ASP.net with VB.Net on Visual Studio 2010 (.Net Framework 4).

I'm trying to use a datarepeater class to display results from a query on the web page so I coded away exactly as I used to in Visual Studio 2008. However, I am getting syntax error messages where I am trying to display the data values:

<table>
   <asp:Repeater ID="repeater1" runat="server">
   <HeaderTemplate>
   <tr>
   </HeaderTemplate>
   <ItemTemplate>
     <td><%# Eval("Item1")%></td>
   </ItemTemplate>
   <FooterTemplate>
   </tr>
   </FooterTemplate>
   </asp:Repeater>
</table>

I'm getting the syntax error at the following: <%# Eval("Item1")%> The Error I get is: Expression expected