|
Hi,
After you uploaded files into server , you are still be able to rename that file, specify file that u want to rename and then click on rename button , that's it,
Hy Chanhan,
I am a student at BBU in Cambodia.
In major: Information Technology.
This web is so interested.
|
|
|
|
|
Hi,
After you uploaded files into server , you are still be able to rename that file, specify file that u want to rename and then click on rename button , that's it,
Hy Chanhan,
|
|
|
|
|
THX for reply
If the user uploaded file name is photo.jpg
Then
On upload time i want to change and save that file as id.jpg (BY programetically)
I am using this code
-----------------------
Dim fileName, pathname As String
fileName = Path.GetFileName(upfile.PostedFile.FileName)
If File.Exists(("c:\Rename" & "/" & fileName)) Then
File.Delete(("c:\Rename" & "/" & fileName))
End If
upfile.PostedFile.SaveAs(("c:\Rename" & "/" & fileName))
File.SetAttributes(("c:\Rename" & "/" & fileName), FileAttributes.Archive)
THX
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
|
and probably replace your forward slash with a backslash...
|
|
|
|
|
Is there any method to place the ASP.NET textbox CONTROL into the edititemtemplate of the datagrid dynamically?
Please help.
|
|
|
|
|
ItemCreated is possible
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Hi Dear,
I want to share a problem, in developing a website using Asp.Net2.0(C#).
We are in a process of building a website,where i need to include a shoppingCart.
Since i am not an expert in developing,i would like to share my problem, friends like you.
Thanks for Sharing the Problem,Hope to get suggestions/solutions at your convenience.
-- modified at 5:47 Friday 28th July, 2006
With Regards
Satips
|
|
|
|
|
|
Thanks for ur Help,
I have got the idea of building the Shopping Cart for my project.
i should once again thankyou for rendering me a suitable link from the microsoft site itself.
it is easy in programming.
happy regards,
With Regards
Satips
|
|
|
|
|
I have a DataGrid with select buttons on it, when I press a button the page is refreshed only. The problem is that the ItemCommand event is not occuring and I can not figure out why.
Every thing that I have read say it should be working. Including a search of past post to this db.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Can you post a bit of your datagrid declaration?
|
|
|
|
|
May be there would be some problem in the HTML(datagrid declaration) part.
Best Regards,
Apurva Kaushal
|
|
|
|
|
when creating the datasource save it into the ViewState
when posting back set the datasource to the viewstate table
when you use a new datasource .net will wipe all events. Which is what is happening
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Thanks,
I did not think the question posted or I would have posted my solution to the problem. What you say is exactly what was happening. I was not checking if the page was loading via a post back, once I did that everything worked correctly.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Sorry man. Clicked on the wrong person to reply too.
my apologies
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Hi!! What are some starting points for learning about how to create and show custom right click pop "command bars" in Web Forms?
Thanks!
|
|
|
|
|
Try starting with a Google search on "asp.net popup menu". I found some good articles that should give you some ideas.
|
|
|
|
|
Hi all,
I have a requirement to add a checkbox to a datagrid, but on some rows.
If I am asking something that's already covered elsewhere, I apologise.
I have tried a couple of things, but not go
Please find below the code of what I am trying to do (flames welcomed ).
I would greatly appreciate feedback on this.
<br />
<br />
Private Function fnPopulateDataGrid()<br />
Try<br />
' Define a dataset the is used to store the retrieved data from SQL<br />
' This dataset is going to be used to hold multiple result sets.<br />
' These result sets are:<br />
' * Country<br />
' * Region<br />
' * Dates - From the diary<br />
' * Merchandisers<br />
' * Account details and Merchandiser claim details<br />
Dim oDS As DataSet<br />
'<br />
' This is the data table used to 'massage' the result sets for output.<br />
' It is our generic 'container' used for the purpose of our results which<br />
' we WANT to have programatic control over.<br />
Dim oTable As DataTable = New DataTable("RESULTS")<br />
'<br />
' Set up columns in the results table (oTable)<br />
' Note how we actually define the column header, and the data type the column will<br />
' be utilising. We could have avoided this, but for type save conversions<br />
' it is much more safer to have explicite types (as we do in database fields for tables).<br />
oTable.Columns.Add("Country", GetType(System.String))<br />
oTable.Columns.Add("Region", GetType(System.String))<br />
oTable.Columns.Add("Diary Date", GetType(System.String))<br />
oTable.Columns.Add("Merchandiser", GetType(System.String))<br />
oTable.Columns.Add("Customer", GetType(System.String))<br />
oTable.Columns.Add("Claim Time", GetType(System.String))<br />
oTable.Columns.Add("Claim Kms", GetType(System.Int32))<br />
oTable.Columns.Add("Approved", GetType(System.Web.UI.WebControls.CheckBox))<br />
'<br />
' New instance of a check box for the approve facilitation.<br />
Dim oCheckBox As CheckBox = New CheckBox<br />
oCheckBox.Visible = True<br />
oCheckBox.Enabled = True<br />
'<br />
' Here is defined each table to be used to map to each result set<br />
' obtained from the data set<br />
Dim oCountryTable As DataTable = New DataTable("Countries")<br />
Dim oRegionTable As DataTable = New DataTable("Regions")<br />
Dim oDiaryDateTable As DataTable = New DataTable("DiaryDates")<br />
Dim oMerchandiserTable As DataTable = New DataTable("Merchandisers")<br />
Dim oCustomerTable As DataTable = New DataTable("Customers")<br />
'<br />
' And now we define our rows to be added into out data table for output<br />
' oRow is a 'generic' row used specifically for the output data table.<br />
' We use this row to populate each column (as defined above).<br />
Dim oRow As DataRow<br />
'<br />
' And now a row defined for each data table in our data set.<br />
' We want to have a data row defined so we can access the details, form<br />
' relationships and use for processing<br />
Dim oCountryRow As DataRow<br />
Dim oRegionRow As DataRow<br />
Dim oDiaryDateRow As DataRow<br />
Dim oMerchandiserRow As DataRow<br />
Dim oCustomerRow As DataRow<br />
'<br />
' The function called returns a DataSet<br />
' Lets call our business facade method to get us our mechandisers passing no parameters <br />
' at this point.<br />
' The parameters are obtained from within the function.<br />
' We eventually call sp_getMerchandiserClaimDetails stored procedure.<br />
' Note: We are using the Microsoft Data Access Blocks, which is a part of the Microsoft Enterprise Blocks<br />
' (Just so that it is a bit more repeatable, and robust - like java - haha).<br />
oDS = fnGetMerchHierData()<br />
'<br />
' Now we have our data set with multiple result sets, we want to store these results into<br />
' a table of their own.<br />
' In this case we want to have a country, Region, Date, Merchandiser and Customer table<br />
' so we can use more efficiently and cleanly going forward.<br />
' We can address each result set in the data set by referencing the index (as we haven't named them<br />
' for efficiency purposes. We name 'things' going forward for readability and supportability<br />
' purposes.<br />
' Once we have our addressed result set from our data set populated from the business facade,<br />
' we explicitely set it to our prior defined data tables so we can use them in an<br />
' object-relational fasshion (as per below).<br />
oCountryTable = oDS.Tables(0)<br />
oRegionTable = oDS.Tables(1)<br />
oDiaryDateTable = oDS.Tables(2)<br />
oMerchandiserTable = oDS.Tables(3)<br />
oCustomerTable = oDS.Tables(4)<br />
'<br />
' Now we define our relationships between our data tables.<br />
' Note how we define it to our Data Set, as it is the primary container for all the tables.<br />
' Note: a data set is an in memory data base (IMDB).<br />
' Note: We hare using 3 parameters in the .Relations.Add method as opposed to 4.<br />
' The 4th parameter is used to overide whether or not a constraint is formed or not.<br />
' By default (by excluding this parameter) it forces a constraint.<br />
' This has been intentionally designed this way to ensure we do not violate any<br />
' integrity rules, and also ensure we have correct data as we populate our data table.<br />
' Note: Because of the way we are forming these relation ships, we actually creating<br />
' Parent -> Child -> Sub-Child -> Sub-Sub-Child -> Sub-Sub-Sub-Child relations<br />
' in the following fasion:<br />
' Country -> Region -> Dates -> Merchandisers -> Accounts serviced and claim details<br />
' First establish a relationship between Country as our parent to child records, Regions.<br />
oDS.Relations.Add("Regions", oCountryTable.Columns("CountryID"), oRegionTable.Columns("CountryID"))<br />
'<br />
' Next, we define a relationship between Region as the parent to child records, Dates.<br />
oDS.Relations.Add("DiaryDates", oRegionTable.Columns("RegionID"), oDiaryDateTable.Columns("RegionID"))<br />
' Next, we define a relationship between Dates as the parent to chile records, Merchandisers.<br />
'oDS.Relations.Add("Merchandisers", oDiaryDateTable.Columns("DiaryDate"), oMerchandiserTable.Columns("DiaryDate"))<br />
oDS.Relations.Add("Merchandisers", oDiaryDateTable.Columns("DiaryRegionID"), oMerchandiserTable.Columns("DiaryRegionID"))<br />
' Finaly, we establish a relationship between Merchandisers as the parent to the child records, the accounts serviced.<br />
oDS.Relations.Add("Customers", oMerchandiserTable.Columns("DiaryID"), oCustomerTable.Columns("DiaryID"))<br />
'<br />
'<br />
' Now the hard yakka. Lets go through our data tables (related).<br />
' Because we now have a relationional IMDB, we can access this in a programatic fashion.<br />
' We start off with our 'base' table, being Countries, and access the child, sub-child records<br />
' as defined in our relationships above.<br />
' Note: For each 'dimension' specified we generically add a row to our data table (oRow within Table)<br />
' so we can accordingly add the dimension specific (column) to the row to represent the detail<br />
' required in a hierarchical fashion. So, in essence we have grouped data into their logical<br />
' relation.<br />
' We cascade 'down' the relations in the order of parent -> child definitions.<br />
' This is: Country -> Region -> Dates -> Merchandisers -> Accounts serviced and claim details.<br />
' Note : To obtain the child details from the parent form, we use the .GetChildRows(SubstituteTableNameHere).<br />
' This utilises the data tables defined above, the relations formed above them, and<br />
' we can be sure that the integrity is maintained by the rules upon forming the relations.<br />
For Each oCountryRow In oCountryTable.Rows<br />
oRow = oTable.NewRow()<br />
oRow("Country") = oCountryRow("Country")<br />
oTable.Rows.Add(oRow)<br />
For Each oRegionRow In oCountryRow.GetChildRows("Regions")<br />
oRow = oTable.NewRow()<br />
oRow("Region") = oRegionRow("Region")<br />
oTable.Rows.Add(oRow)<br />
For Each oDiaryDateRow In oRegionRow.GetChildRows("DiaryDates")<br />
oRow = oTable.NewRow()<br />
oRow("Diary Date") = oDiaryDateRow("DiaryDate")<br />
oTable.Rows.Add(oRow)<br />
For Each oMerchandiserRow In oDiaryDateRow.GetChildRows("Merchandisers")<br />
oRow = oTable.NewRow()<br />
oRow("Merchandiser") = oMerchandiserRow("Merchandiser")<br />
oTable.Rows.Add(oRow)<br />
For Each oCustomerRow In oMerchandiserRow.GetChildRows("Customers")<br />
oRow = oTable.NewRow()<br />
oRow("Customer") = oCustomerRow("Customer")<br />
oRow("Claim Time") = oCustomerRow("ClaimTime")<br />
oRow("Claim Kms") = oCustomerRow("ClaimKms")<br />
'<br />
' Add the Approved value as a checkbox control<br />
If oCustomerRow("Approved").GetType.ToString = "System.DBNull" Then<br />
oCheckBox.Checked = False<br />
Else<br />
oCheckBox.Checked = CBool(oCustomerRow("Approved"))<br />
End If<br />
oRow("Approved") = oCheckBox<br />
'<br />
oTable.Rows.Add(oRow)<br />
Next<br />
Next<br />
Next<br />
Next<br />
Next<br />
'<br />
' We now want to add our data table (oTable) to our result set (oDS) just incase we want to<br />
' further process any details within our data set (oDS).<br />
' so, we have our original result sets from our busines facade, and our 'processed'<br />
' data table (oTable) from this function.<br />
oDS.Tables.Add(oTable)<br />
'<br />
' We now define to our data grid (dgMerchandiserClaimData) the source of where it will be<br />
' getting it's data to present.<br />
' Because we have gone to the effort of 'processing' and generating our own data table (oTable),<br />
' we want to actually use this explicitly.<br />
' We have opted to specify .DefaultView which gets any defined customized<br />
' view of the table which may include a filtered view, or a cursor position. We haven't defined<br />
' any of these customisations for our purposed, but it gives us the ability to do so incase we do.<br />
dgMerchandiserClaimData.DataSource = oTable.DefaultView<br />
'<br />
' Add our checkbox to the grid :S<br />
'dgMerchandiserClaimData.Columns.Add(oApprovedColumn)<br />
'<br />
' Now we actually form the bind from the defined data source to the grid.<br />
dgMerchandiserClaimData.DataBind()<br />
<br />
Catch ex As Exception<br />
Throw New Exception(ex.Message, ex)<br />
End Try<br />
End Function<br />
<br />
Thank you and Kind Regards,
John Zantey
|
|
|
|
|
That's a lot of code to read through...
could you not just add a checkbox column to your datagrid and then on the item databound event set it to not visible for those items where you don't want it to display?
|
|
|
|
|
You have to add a template column in which you have to place a checkbox.
Now at runtime you have to make a loop on all datagrid rows. Now in loop find control i.e. checkbox and make the checkbox visible property to false where you donot want to show the check box.
Do good and have good.
|
|
|
|
|
I have a web application which uses oracle database. Below is the minimum code which explains how I am accessing the data.
At a time the application working fine and I can access and do everything with database. Some other time database server is down for scheduled maintenance. If I try to run the application at this point of time it will raise err "ORA-12154: TNS:could not resolve service name"
(I'm catching this exception and displaying a custom error message to users). After some hours the database server is up an running.
Now if I run the application it should behave normal and give database access. But it dose not, and continue to give the same ORA-12154" error.
In such case I have to reset IIS to make the application work normal. So the question is how to avoid re-occurring Err "ORA-12154".
private string get_name()
{
string name = "no name";
string conn_str = "Provider=MSDAORA.1;Persist Security Info=True;Data Source=test;User ID=test;Password=test";
OleDbConnection db_conn = new OleDbConnection(conn_str);
db_conn.Open();
string str_sql = "select name_complete from emp_master " +
"where emp_no = '" + TextBox1.Text + "'";
OleDbCommand db_cmd = new OleDbCommand(str_sql, db_conn);
OleDbDataReader db_reader = db_cmd.ExecuteReader();
while (db_reader.Read())
{
name = db_reader[0].ToString();
}
db_reader.Close();
db_conn.Close();
return name;
}
CA Keer.
|
|
|
|
|
Your issue might be oracle specific, however I've experienced a somewhat similar problem due to connection pooling in Firebird and MS SQL server. You might want to try emptying the connection pool forcefully when you get that exception.
|
|
|
|
|
also not calling Dispose on the connection object will not pool the connection
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
I tried your suggession as below but dose not solve the issue. The issue is not related to Oracle i guess. Because everything is same and I only have to reset IIS. Thats restores the database access to normal.
try
{
dbConn.Open();
}
catch(Exception ex)
{
dbConn.Dispose();
}
CA Keer.
|
|
|
|
|