|
hi..
I'm a newbie in asp.net and need to work on a problem log website.Can anybody send me a sample code or a tutorial where to start?
Like how can I connect the data filled by the user to a database? How to authenticate users and so on...
THanks in advance.
|
|
|
|
|
|
there are several sites you can start from and one of them is www.asp.net
Then there are many other sites like www.csharpcorner.com
If you are using ASP.NET 1.1, then you need to make your custom authentication.
If you are using ASP.NET 2.0, then there is a built in authentication in it.
Sandeep S. Sekhon
|
|
|
|
|
Hi all, I have an issue when I try to load an activeX in a ASPNET project, when I use early binding I get an error like Query interface failed, and when I use late binding I get "cannot create activex component", I know there security stuff to check in dcomcnfg tool , and a security patch Qsomething, but none of this seems to work.
this problem is driving nuts, and I will be greatful if someone have any clue.
Thanks
bat76230 FrenchDeveloper
|
|
|
|
|
Hi there,
Are you sure that the ActiveX control is installed on the client machine when you want to create it on the web page at the client side? If not, you may need to look at the codebase attribute to point to the location where the ActiveX can get downloaded.
|
|
|
|
|
i am new to asp.net and i am using asp.net 2003 and sqlserver2000
i had problem whle uploading file into database
i had task upload file into database
plz help me , and send any code for this
prasad.g
|
|
|
|
|
If it is an image file, then you can upload it into the database. If it is any other file, then you can store the address or path of the file in the database and store the file at the location specified in the database.
You can use HTML file input control to upload file into the database.
Sandeep S. Sekhon
|
|
|
|
|
You can save any file you like into the DB, there are couple of good article on this site about file upload, if you have a search, they should answer your questions.
|
|
|
|
|
How do i display image from a database on an ASP page.
being read in a stream. which component should i use.
doing so is possible in window based application
This Is the code
SqlCommand comm = new SqlCommand("select photo from photos where name='sachin'", conn);
byte[] b = (byte[])comm.ExecuteScalar();
if (b.Length > 0)
{
// Open a stream for the image and write the bytes into it
System.IO.MemoryStream stream = new System.IO.MemoryStream(b, true);
stream.Write(b, 0, b.Length);
//if c#'s window based application then i can do it like this
//pictureBox.Image = new Bitmap(stream);
}
Sarbjeet Singh
|
|
|
|
|
I'm affraid you have to save the image to your disk and then set ImageUrl property of System.Web.UI.WebControls.Image object to url of saved image.
Pilo
|
|
|
|
|
Do i have the permission to write on clients HDD.
probably i can write in temp folder which is inside Windows or Winnt folder.
how do i get the system folder's name i mean is it windows or winnt
Thanks
|
|
|
|
|
You can not write to a folder outside an application root. Imagine if users can display files from Windows folder... no no, that's bad idea
Just create folder Images in your application root (c:\inetpub\wwwroot\MyApp usually) and set permissions to write to this folder for user IUSR_MACHINENAME, where MACHINENAME is name of your computer. This user is account IIS is running under. Then you can assign this url to your Image control: "~/Images/mySavedImage.jpg"
Should be working, if not, write down what is wrong.
Pilo
|
|
|
|
|
i am reading the image from the database.
what will happen if three four users come at the same time.
Regards
|
|
|
|
|
|
its working!!!!!!!!!!!!
But dont knwow how it will behave when different users with same file name and same extension will visit at the same time.
Thanks AnyWays
If Some problem come up i will get back
Regards
|
|
|
|
|
U have to check if file with this name exist, and if so, just put number at end of the name:
myImage.jpg
myImage1.jpg
And you should have some mechanism to check how long files are there and delete them after some time...
Pilo
|
|
|
|
|
Thanks is't working
Regards
|
|
|
|
|
Either do 3 things.
1) Have a aspx page that draws the picture
Set the content type to jpeg or whatever and load the binary values into it
2) Save the image to a local file so the image can be saved and set the path.
3) you might be able to just take the data create create a stream out of it. then apply it to an image object. But it prolbably won't work in the end
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
do i hav ethe permission to write on clients machine.
how to get the name of system folder.
Sarbjeet Singh
|
|
|
|
|
nope. If you could then viruses could easily be delivered to everyone. Thats why you cant.
Just create a local file ( it will place it in the windiws\temp web app folder. and reference it
you dont need to specify a path. just use the web root or something.
It might be easier to just have a page that displays as a jpeg since you dont have to save the file anywhere. But you also have to realize thats an extra request. But, its the easiest
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Heh, good idea with content type, I didn't think about it
But it is useable only if you want to have single image on a page and nothing else, otherwise it wouldn't works, I suppose.
Pilo
|
|
|
|
|
yeah.
But if you have a DataList or what not calling that page then you could display mutiple pictures on one page
Not the best route for more then 5 pictures. But it would work
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Please let me know in detail What are HttpResponse and HttpRequest objects
Regards,
Sivaprasad
|
|
|
|
|
why u don't use google??
u don't have specific question, just general, what is HttpResponse and HttpRequest... and you want answer in detail!
Do you expect somebody to write several pages here about these two objects? Be more specific, what do you want to know, or what kind of problem you have.
google.com -> msdn HttpResponse -> the first page is http://msdn2.microsoft.com/en-us/library/system.web.httpresponse.aspx
google.com -> msdn HttpRequest -> the first page is http://msdn2.microsoft.com/en-us/library/system.web.httprequest.aspx
sufficient? not? then think about what information these pages are missing and put these words instead of "msdn" in google.
Remember google, is your best friend in a world of internet
Pilo
|
|
|
|
|
I want to develop applications using AJAX , for this do I need to load any software to develop AJAX based applications.
Sridhar B.
|
|
|
|