|
Assuming you are loading the images from a folder, or database, then you either have the name or id of the selected image. Store it in a session variable, cache, query string and pass it along to the next page. Then you can combine the images using whatever method you have written and display it as you normally would an image.
only two letters away from being an asset
|
|
|
|
|
Thanks, that sounds like it would work like a dream.
|
|
|
|
|
There's a web service that's being called no more
than 4 times a week and it must process that each time call.
Each call, the caller will only call once and assumes
that the web service is processing X.
How do you make the web service synchronize (one at time)
and be sure to process X whenever it's being called?
One idea is to create an Application variable that
holds if web service is processing.
So, in the web service method:
Main sub ()
'First thing it does is check the Application var
'to see if it's already processing something.
'If it's processing X then it will just be in an endless loop.
While IsProcessing ()
'do nothing
Next
'Once another web service instance stops processing X,
'it will change the application var to FALSE.
'The Second thing it does is change the App var to False
'b/c it will start processing X.
blah processing X
blah processing X
blah processing X
'The last thing it does is change the App var back to FALSE
End Sub
Of course I'll try to catch an exception if thrown and change
the App var back to FALSE before terminating the process.
If somehow it falls through the crack and doesn't change App var
back to FALSE do I reboot stop/restart IIS or reboot the server?
How will you know if the web service processed X unless it
writes to a datasource indicating that it did before the
method exists, right?
Or is there a better way of handling this situation?
Thanks in advance for your replies!
|
|
|
|
|
hi, how can i expand the 255 words for the microsoft access database. because i need to enter more words than 255. how can i??
thanks!
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Slow down and explain what you mean.
only two letters away from being an asset
|
|
|
|
|
as you know .. the microsoft access allows only length of 255 words maximum. now how can i expand that into a larger scale??
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
ADY007 wrote: microsoft access allows only length of 255 words maximum
Does it? What specifically does it limit to 255 words? Couldn't you get around it by putting underscores between the words so it wouldn't see them as separate words?
|
|
|
|
|
Thanks for your help buy what could i gain if i make the underscores? the problem is that the access cannot allow over than 255 words in one time The member cannot write over than 255 words I think mysql is better than access ey??
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
ADY007 wrote: what could i gain if i make the underscores?
You just insert one big word instead of lots of little words. Then you have no limit!
However, I really think that "words" is incorrect. I don't know what you mean, but I am pretty sure that Access has no limit to the number of "words". Also, you didn't say where these "words" were within Access? So that removes a some context from which I could possibly figure out what you mean.
ADY007 wrote: I think mysql is better than access ey??
I couldn't say. I don't particularly have any strong opinions about either.
|
|
|
|
|
i mean .. letters not words sorry .. my mistake.
I just check ms access and when i go to the design mode of the database, for the ItemDescription for example .. its telling me that the Field Size is 255 and when i try to make it bigger it dont want to maximize it.
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Nope. A field in Access with a "text" datatype is limited to 255 characters maximum. For more characters than that, you can use the "memo" datatype.
|
|
|
|
|
ADY007 wrote: hi, how can i expand the 255 words for the microsoft access database. because i need to enter more words than 255. how can i??
Assuming you are refering to the max column size of a Text field in Access. If you want more than 255 characters then you'll need to use a memo field instead.
|
|
|
|
|
Hi, can i save a textfile on the Server?? I need, that when the user click on the Submit button, i want that the text he inserted will be stored in a textfile on the server.
I know i can use the database and i know how but i need to make a textfile? I can use the streamwriter??
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Yes
only two letters away from being an asset
|
|
|
|
|
thanks very much!!
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Hello,
I have an enum:
Public Enum Color
Red
Blue
Green
End Enum
I need:
1. Loop trough all enum items and get each one value (Ex: Red) and index (Ex: 1).
For Each color As Color In [Enum].GetValues(GetType(Color))
???
Next
2. Get an enum value (Ex: Red) by providing its index (Ex: 1)
I tried various options but I am not able to make this work.
Thank you for your Help,
Miguel
-- modified at 15:05 Friday 12th January, 2007
|
|
|
|
|
So what have you tried? Do you get any exception or are the values not what you are expecting?
only two letters away from being an asset
|
|
|
|
|
Hello,
I have the following:
' Loop through each color enumeration name
For Each color As Color In [Enum].GetNames(GetType(Color))
Dim name As String = MyF(color, Thread.CurrentThread.CurrentCulture)
Dim index As Integer = CType(color, Enumeration.District)
Response.Write("Name: " & name & " | Index: " & index.ToString & "<br />")
Next
I think this is working but I am not sure if this is the best way to solve this.
Note: MyF is a function with a Select Case block which returns a string giving a enum element and a culture. I need this.
However, I now need to get the text of an element by giving its index.
For example, get "Red" when I say 1.
Could someone help me out?
Thanks,
Miguel
|
|
|
|
|
enum Colors
{
White,
Red,
Green
}
int x = 1;
Colors color = (Colors)x;
color.ToString() == "Red"
only two letters away from being an asset
|
|
|
|
|
I created a datatable that binds to a gridview. This datatable holds temporary data. The temporary data is address information. I'm stuck on the gridview part, I can append data to it using an add more addresses button but I'm stuck on the delete button code. Since this doesn't have an sqldatasource or objectdata source, what code do I use to have the selected rows deleted?
Here is my code:
Private Function CreateDataTable() As Data.DataTable
Dim myDataTable As Data.DataTable = New Data.DataTable()
Dim myDataColumn As Data.DataColumn
myDataColumn = New Data.DataColumn
myDataColumn.DataType = Type.GetType("System.String")
myDataColumn.ColumnName = "ID"
myDataColumn.AutoIncrement = True
myDataColumn.AutoIncrementSeed = 1
myDataTable.Columns.Add(myDataColumn)
myDataColumn = New Data.DataColumn
myDataColumn.DataType = Type.GetType("System.String")
myDataColumn.ColumnName = "Address"
myDataTable.Columns.Add(myDataColumn)
myDataColumn = New Data.DataColumn
myDataColumn.DataType = Type.GetType("System.String")
myDataColumn.ColumnName = "City"
myDataTable.Columns.Add(myDataColumn)
myDataColumn = New Data.DataColumn
myDataColumn.DataType = Type.GetType("System.String")
myDataColumn.ColumnName = "State"
myDataTable.Columns.Add(myDataColumn)
myDataColumn = New Data.DataColumn
myDataColumn.DataType = Type.GetType("System.String")
myDataColumn.ColumnName = "Zip"
myDataTable.Columns.Add(myDataColumn)
myDataColumn = New Data.DataColumn
myDataColumn.DataType = Type.GetType("System.String")
myDataColumn.ColumnName = "Yrs"
myDataTable.Columns.Add(myDataColumn)
Return myDataTable
End Function
Private Function AddDataToTable(ByVal Address As String, ByVal City As String, ByVal State As String, ByVal Zip As String, ByVal Yrs As String, ByVal myTable As Data.DataTable)
Dim row As Data.DataRow
row = myTable.NewRow
row("Address") = Address
row("City") = City
row("State") = State
row("Zip") = Zip
row("Yrs") = Yrs
myTable.Rows.Add(row)
Return row
End Function
Protected Sub btnaddress_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnaddress.Click
panel1.Visible = "True"
End Sub
Protected Sub btnaddresses_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnaddresses.Click
If txtaddress.Text.Trim = "" Then
lbladdresses.Text = "You must fill in a address."
Return
Else
AddDataToTable(Me.txtaddress.Text.Trim, Me.txtcity.Text.Trim, Me.txtstate.Text.Trim, Me.txtzip.Text.Trim, Me.txtyear.Text.Trim, CType(Session("myDataTable"), Data.DataTable))
Me.GridView1.DataSource = CType(Session("myDataTable"), Data.DataTable).DefaultView
Me.GridView1.DataBind()
Me.txtaddress.Text = ""
Me.txtcity.Text = ""
Me.txtstate.Text = ""
Me.txtyear.Text = ""
Me.txtzip.Text = ""
Me.txtyear.Text = ""
End If
End Sub
If Me.IsPostBack = False Then
Dim MyDt As New Data.DataTable
MyDt = CreateDataTable()
Session("myDatatable") = MyDt
Me.GridView1.DataSource = (CType(Session("myDatatable"), Data.DataTable)).DefaultView
Me.GridView1.DataBind()
End If
End Class
|
|
|
|
|
If you don't use any data source control with the GridView, you manually hook up the GridView 's events to do what you need. Here, you can create an event handler for the RowDeleting event, and in this method you can determine the row being deleted using the event argument instance or the control properties, you then can delete the row in your data source. In addition, you can choose to handle the RowCommand event for a button's click in general, for more information and sample code, you can see GridView Members [^]
|
|
|
|
|
I put this code in:
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
If e.CommandName = "Delete" Then
GridView1.DeleteRow(GridView1.SelectedIndex)
End If
End Sub
End Class
I'm getting an error:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
What should I Do?
|
|
|
|
|
There are a couple of things to talk about your sample code here:
+ To get reference to the row index to delete in the RowCommand event, you should use the e.CommandArgument , and e.RowIndex in the RowDeleting event.
+ Basically, calling DeleteRow method makes the two events RowDeleting and RowDeleted get raised, however this code does not make sense in this case as these two events automatically get raised by the control when the CommandName is Delete . So you don't need to call DeleteRow method, instead you should place your code to delete the selected row in the temp data source, then rebind it to control.
+ Like I said above, when the CommandName is Delete, you should use the specific event RowDeleting, put your code to delete the row there, and finally cancel the event.
|
|
|
|
|
This is a stupid question but what should I put in the row command event then?
|
|
|
|
|
Thanks, I figured it out.
|
|
|
|