|
Does your mail server requires authentication .. .
If so then login using authentication before sending mails.
|
|
|
|
|
Hi
I am able tp uplaod the files into the directory that i specified.
But the thing is when i upload the file, i want the information of the file ( file size, time of upload, file name etc) to be auto updated into the database.
please help!!
|
|
|
|
|
daffy_2003 wrote: But the thing is when i upload the file, i want the information of the file ( file size, time of upload, file name etc) to be auto updated into the database
When you are uoloading the file, you can easily do that. From PostedFile, you can get the FileName and FileSize . and when you are stroing it to database, just add a timestamp.
Like,
string strFileName=string.empty;
string strError=string.empty;
int FileLenght=0;
if (FileUpLoad1.HasFile)
{
FileUpLoad1.SaveAs(DestinationDir + FileUpLoad1.FileName);
strFileName = FileUpLoad1.FileName ;
FileLenght = FileUpload1.PostedFile.ContentLength
SaveFileDataInDB(strFileName,FileLength, DateTime.Now)
}
else
{
strError = "Error...";
}
Note : This is C# Code. Hope you can do it in VB.NET Now
Hope this will help you
|
|
|
|
|
hi thanks for the fast reply! i will try it out!
|
|
|
|
|
Cool. Let me know if you have any further issue.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi there, i tried out and it does display the info in the grid view. however, when a new file is uploaded, the existing info in the gridview is being overwrite by the new one. Any idea how to not let it overwrite the previous data? thanks!
|
|
|
|
|
daffy_2003 wrote: however, when a new file is uploaded, the existing info in the gridview is being overwrite by the new one. Any idea how to not let it overwrite the previous data?
This is why, I guess you didnt check the IsPostback Property on Page_Load().
So when the Image is uploading, Page is getting postback and grid is binding with blank data.
Do something like this is Page_Load
if( ! Page.ISPostBack)
{
BindGrid();
}
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hey there, it doesn't work. And another problem is that i have to close the page and open again before the gridview update itself. what should i do?
|
|
|
|
|
I want to bind not all but one part of columns of a datasource to a gridview, but I do not know which function can be used?
for example, the following code is used to bind all columns of database "Departments" to gridview departmentsGrid.
departmentsGrid.DataSource = dataSet.Tables["Departments"].DefaultView;
departmentsGrid.DataBind();
Note that for the gridview, I have set "AutoGenerateColumns" as True.
therefore, I have to select all the columns to bind. perhaps, I can set "AutoGenerateColumns" as False and then bind the columns one by one?
or is there any better solution?
thank you!
|
|
|
|
|
You have to do it on RowDataBound Event of Gridview.
|
|
|
|
|
It is always better to specify columns on the designer and AutoGenerateColumns false. So that if the selection to departments changes the page becomes intact.
|
|
|
|
|
I want to bind the gridview to a datasource which contains one image field. I have the following questions:
1: I use SQL 2005, it seems to be there are one 'image' type and one 'varbinary(max)', which one should be used?
2: in order to bind the imagefield to the gridview, i have to add one imagefield in the gridview, because gridview can not automatically to bind it.
but I use the following code, the image can not be displayed, instead of a red cross:
<asp:ImageField HeaderText="image" NullDisplayText="no"
NullImageUrl="~/Images/book_closed.gif" DataImageURLField="ImageTest">
</asp:ImageField>
<asp:sqldatasource id="DepartmentsSource"
selectcommand="Select [DepartmentID], [DepartmentID], [ImageTest],[Tel] From [Departments]"
connectionstring="Server=localhost\SqlExpress;Database=Dorknozzle;Integrated Security=True" providerName="System.Data.SqlClient"
runat="server"/>
anyone can give me one hint why?
thank you!
|
|
|
|
|
|
thanks, oh, right, your save image file just as the string path and it is GOOD.
|
|
|
|
|
Hello All,
I have designed menucontrol which renders dynamically by reading Xml file.
Here i am facing problem while applying differnt styles to menu item for static Menu
Please refer below diagram for Menu control, that i want to design programatically whose MenuItem text can be changed dynamically by changing Xml file.
Here i am not able to apply different style to menu item, I want "At School" & "At College" to be bold and "SclItem1 2 3" & "ClgItem1 2" to be in Normal font with some padding to its left programatically.
If you have any idea please post here or mail me on vikramkulkarni2007@gmail.com
Diagram
Education
--------------
At School -->Needs to be bold
SclItem1 -->Normal font
SclItem2
SclItem3
--------------
At College -->Needs to be bold
ClgItem1 -->Normal font
ClgItem2
--------------
Please do reply
Thanks,
Vikram
|
|
|
|
|
|
Hi there ..
i design manually a gridview with 3 bound column and 3 button collumn
how can i add the values of datatable to bound column in gridview
i used the code
GridView1.Rows(0).Cells(3).Text = dt.Rows(0)("Year").ToString
but its is always give error out of index range
i wrote gridview1.datasource= datatable
gridview1.databind()
but no values appear it just appers when i used autogenerateproperty = true ( No designed GridView )
so my question is how to add value to viewgrid bound coulmn or template column ?
or how to add new row to grid view ?
or how to set the colloumn button at the end of the grid ??
one of these question will help me
thank you very much
|
|
|
|
|
Bannoota wrote: or how to add new row to grid view ?
You want to add records from gridview ?
Have a look into it.
Adding an insert row to GridView[^]
Or you want something different ?
|
|
|
|
|
I'm busy getting to grips with my first Dynamic Data project, using LINQ to Entities. It's going quite well so far, but on my Employees edit form, when I click the 'Update' link, it calls back to the Edit.aspx page, but nothing else happens. No SQL is sent, and no error is raised. I have had this problem before with a SqlDataSource simply swallowing exceptions, but I've been led to believe that the object based DataSource components are better behaved.
I have no idea where to begin looking, because the Edit.aspx has no explicit update code in it, so I have this dark cloud between it and my DB where something is happening to my update, which is anybody's guess.
|
|
|
|
|
why dont you debug the application and see what error is occurring. Have you seen SQL profiler as if there is any entry of update statement being generated and the error is generated in SQL server or not?
|
|
|
|
|
There is nothing to debug. My break point in the Updating event hits, but not the updated event. No SQL is sent through. I've discovered that something, probably EF, doesn't like self-referencing tables, e.g. the Employees table has a one-to-many relationship with itself, because the Supervisor field points back to an EmployeeID.
|
|
|
|
|
I am nw develop a website and in my project,login form can aslo be included and i have designed this through layers and tables.But is any how user dont fill correct username or password an alert will be shown by javascrpt which disturb my interface slightly...
please help me or suggest for this..what can i do for resolving that problem
|
|
|
|
|
Nitinpro wrote: which disturb my interface slightly...
What do you mean you distrub interface ? Any allignment problem or what ?
|
|
|
|
|
yes sir,alignment can be disturbed while alert can be shown...sr please suggest me for this problem ..how it can be resolved??
|
|
|
|
|
Why do you want to show javascript alert ?
If user is not authenticated properly show a nice message in Red color just below the Login box like "Username/Password is incorrect. Please relogin" as every site does.
You may have Forgot Password link as well.
|
|
|
|