|
always welcome..
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi.
i have a prblm while i try to read the image from sqlserverdatabase 2000 and showing in asp.net datagrid,on backend i m using vb.net.the error in "invalid Casting" tell me how can read the image from database and show in my asp.net datagrid.
this is my code that i use to pull the image from sqldatabase.
public funciton bindata()
Dim connstring As String = ConfigurationSettings.AppSettings.Item("DBSettingsServer")
Dim con As SqlConnection
Try
con = New SqlConnection(connstring)
con.Open()
Dim cmd As New SqlCommand
cmd.Connection = con
Dim dst As New DataSet
Dim dr As SqlDataReader
'cmd.CommandText = "Select * From tblNews where " & Request.QueryString("id")
'cmd.CommandText = "Insert into tblnews (NewsID,NewsDesc, NewsImg,NewsStatus) values (@NewsID,@NewsDesc, @NewsImg,@NewsStatus)"
' cmd.CommandText = "Select * from tblnews where NewsID = " & Request.QueryString("id")
cmd.CommandText = "Select * from tblnews where NewsID = 000001 "
dr = cmd.ExecuteReader
If dr.Read() Then
Dim bindata() As Byte = dr.GetValue(3)
Response.BinaryWrite(bindata)
End If
con.Close()
Catch ex As Exception
'Response.Write(ex.ToString)
con.Close()
Throw ex
Finally
con.Close()
End Try
End Function
tell me how can i read the image from sqlsever database
or tell me where i m wrong
|
|
|
|
|
Here you can get help for image storing and retrieving using sql server 2000.
http://www.codeproject.com/cs/database/ImageSaveInDataBase.asp
Best Regards,
Apurva Kaushal
|
|
|
|
|
I'm having a bit of a reocuring problem that I just cant seem to get my head round.
I want the output of an SQL query to be placed into an XMLDocument (for use as a source for an ASP.NET XML tool).
At the moment my SQL query outputs using: FOR XML AUTO, ELEMENTS
But I dont really have any experiance using the XMLDocument and was wondering how I should go about getting the output from the SQL query into the XMLDocument??
Is there a simple way of just "shoving" it in there or is it an intricate element by element process ?
Thanks.
|
|
|
|
|
I have three Select buttons in GridView Control.
Now how can i capture which button is clicked.
If I use TemplateColumn (ImageControl) CommandName Property = "Add User" then i m unable to get
SelectedIndex of GridView Control.
Any idea Please......
Know Yourself Then Grow Yourself.
|
|
|
|
|
If you are in the itemCommand event of the gridView, then you can check for the correct item command like so:
if (e.ItemCommand == "Add User")
{
}
and then the current row should be e.Item .
|
|
|
|
|
Thanks
Know Yourself Then Grow Yourself.
|
|
|
|
|
Hi,
Actually I want to create a folder on client's computer and save an Excel file into that folder when the user clicks on save button. Is it possible to achieve this using ASP .Net 2.0
Right now when I create a folder at location "C:\folder1", it creates a folder on the Web server.
Plz help me if u can...
|
|
|
|
|
As far as I am aware ASP.NET is server side only meaning you cant do this kind of thing on a clients computer by ASP.NET alone... imagine the security problems if you could!
You may need to install software on the cleints computer and launch it via ASP.NET (I think there is a tutorial on Codeproject for doing this) or use somthing like JavaScript (though not sure even that is possible.. becuase, again, its a big security issue)
|
|
|
|
|
i also want to create folder in client computer. how i can create? about which tutorial of code proj. u are telling?
pls help me.
sanjay s/w ltd
|
|
|
|
|
red wizard is right. You can't do this just with ASP.net. Your best bet would be to just let the user download the file and save it wherever they like.
|
|
|
|
|
have a webform and I want to create a hyperlink to a text file, so that it
opens on internet explorer in a new window.
I have added the following
testhyperlink
Now when I click on the hyperlink, nothing is happening. No error.
when I open a browser and type file:///D:/Test/Test.txt, the file is opening.
please help me.
kamalnath
|
|
|
|
|
Hi kamalnath,
I think you are using the physical path of the file. Try changing the URL to ---
http://localhost/<ur web="" app="" name="">/Test.txt
Hope this works !
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
hi anant
file is in d drive .then how to get that file
kamalnath
|
|
|
|
|
I think you should use method PathMap to convert the physical address to URL.
Good luck!
galaxy
|
|
|
|
|
I have a web application in ASp.net . I want to display barcode at client browser without installing barcode font at client side.
Pls Reply
Thanks in Advance
Urgent
|
|
|
|
|
Hi
I've done that with a Web Service returning a byte[]. Then I create an image dynamically with this data.
More info here[^]
Hope it helps.
Cheers
Laurent
|
|
|
|
|
Hai i am new to asp.net i have small problem , i was useing asp.net2003 and sqlserver as backend
problem is :
i have login page with uid and password (textboxes)
when user enter valid user& password user enter into next page
table contain uid,password,username,usercode
userid=010101 password =010101 username='ramesh' usercode=01
userid like =010101 based on that first two digits i have diaply username into second page
how to use substring query in that
plz help me it is urgent
prasad.g
|
|
|
|
|
Do you want to get the first two characters of the strng?
if so then you can use like this:
userid.Substring(0,2);
Best Regards,
Apurva Kaushal
|
|
|
|
|
Prasad.garlapati wrote: based on that first two digits i have diaply username
Prasad.garlapati wrote: ,username,usercode
username = username.Substring(0,2);
if you want to pass in another page u acn use sessions ,querystring,etc
Example:
<br />
Session["twodigits"] = username.ToString();<br />
<br />
<br />
<code>string twodigirs = Session["twodigits"].ToString();
|
|
|
|
|
This is a useless subject line.
Everyone who starts a thread on this forum is looking for help in some form or another.
Saying that it is "urgent" is pointless too. We are not paid to give you support. You'll get help if someone knows the answer and is willing to help and for no other reason. If it really is urgent then I suggest that you pay for support.
|
|
|
|
|
I just deployed a new web and my global error handler is sending me back of
ton of nessages that say "Invalid_Viewstate_Client_Disconnected" complete
with a complete copy of the viewstate - very helpful I am sure. I can't seem
to duplicate the problem. What's up?
Error Msg :
Invalid_Viewstate_Client_Disconnected Client IP: 10.6.174.41 Port:
1639 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
..NET CLR 1.0.3705; .NET CLR 1.1.4322) ViewState:
please help
Praveen
|
|
|
|
|
May be the problem is because all the contents of viewstate from client side are not coming to server side. Are all the settings correct in IIS?
Best Regards,
Apurva Kaushal
|
|
|
|
|
There are several conditions that may cause this issue. Each known condition is presented with a short explanation and a possible workaround.
1. Application Pool Recycling
2. Server Farms or Server Clusters
3. Form Posts
4. Proxy servers and Virus Scanners
Background:
Viewstate represents the state of the page when it was last processed on the server. The contents of the page are stored in a container and moved to and from the server on each request. By default, ASP.NET validates the contents of viewstate to ensure that it has not been tampered. If this validation test fails, an invalid viewstate exception is thrown. Some known issues that cause this test to fail are listed below.
Application Pool Recycling:
IIS 6 will periodically recycle the application pool to maintain the health of the application pool. At the instance when the application pool is being recycled, browser requests may sometimes result in an invalid viewstate error. The fix in this case is to adjust the settings on the application pools so that recycling is less likely to occur at peak periods. This issue represents a bug since the application pool is supposed to gracefully handle this condition.
Server Farms or Server Clusters:
Applications running in a server cluster must have all the machineKey configurations set to the same validationKey. The default autogenerate key cannot be used in a cluster environment. The registry keys responsible for autogeneration are listed here:
HKEY_LOCAL_MACHINE\Software\Microsoft\ASP.NET
HKEY_CURRENT_USER\Software\Microsoft\ASP.NET
When the machineKey is set to AutoGenerate, the key information is stored in the HKEY_CURRENT_USER hive for the account running the process. For W2k3 servers, this is the Network Service account. Otherwise, the account is ASP.NET machine account. When the process launches, ASP.NET will use the HKEY_CURRENT_USER registry key if it is available. If this key is not available, the
HKEY_LOCAL_MACHINE key will be used. If neither registry key exists, the process creates the key in the HKEY_LOCAL_MACHINE hive. If these conditions fail, the process creates a brand new set of keys.
When the application pool is running under a user account, the above keys are not generated leading to an intermittent invalid viewstate error.
The workaround is to use a specific key in the machine.config to prevent automatic key generation on each process start. The key must be exactly 128 bits made up of random characters and inserted into the configuration file on each webserver experiencing the problem.
Form Posts:
Viewstate can only be posted back to the same page. Attempting to post an aspx form to another page will fail with a viewstate invalid exception. This behavior is by design.
One other remedy involves disabling the Machine Authentication Check. Unless, you implement a back up authentication mechanism, you should refrain from this approach. Machine Authentication Checks are important in reducing the attack surface of ASP.NET applications.
Proxy servers and Virus Scanners:
A firewall and/or antivirus software can tamper with the viewstate resulting in an invalid viewstate exception being thrown.
Thanks,
Bimal Kothari
bimal.kothari@gmail.com
|
|
|
|
|
can anyone help me to read the nodes and values of a XML to a multidimensional array.there is only single parent node for my xml page.
Vipin
|
|
|
|