|
Chances are the user under which your code is running doesn't have permissions to the CSV. .NET may run under different users. I'd recommend adding read/modify on that file to the 'NETWORK SERVICE' and 'IUSR' permissions and try it again. Good luck.
Ranjit Viswakumar
Professional Services Specialist
HostMySite.com[^]
|
|
|
|
|
can you plz guid me.. I want to take backup of database containing 15 tables via XML File. And after that Restore it is well. plz help me I am using VB .net & SQL Server
|
|
|
|
|
AhmedNisar82 wrote: I want to take backup of database containing 15 tables via XML File
Sound like a terrible idea. The available backup options are not sufficient for you? How are you going to represent the constraints, triggers, procedures in XML file? You can use it only for representing the data.
|
|
|
|
|
Actually i want to do it on client side..
|
|
|
|
|
Hello everyone!!!
Can anybody tell me how can i set the selectedIndex of dropdownlist whose AutoPostBack property is set to True,
I donot know what is i am doing but i need it .
That is the requirement .
or anyone may suggest me alternative way to do it.
but remember that dropdownlist having AutoPostBack=true
Thanks in advance
daTtA
|
|
|
|
|
Dattatraya Kale wrote:
Can anybody tell me how can i set the selectedIndex of dropdownlist whose AutoPostBack property is set to True,
I donot know what is i am doing but i need it .
I didn't what are you looking for. Can you please be clear?
You can changed the selected index by
DropDownList1.SelectedIndex = intIndex;
|
|
|
|
|
OoOOPs sorry i am not confused but i paste wrong question actually i want to set it from javascript when DropDownList has AutoPostBack=true
|
|
|
|
|
Hi ladies and gentlmen,
I got this error while doing the transactions insert command in a do loop select command.
What I'm trying to do is, 1st to run select command to query filename and filesize (it consists of few results).
Then with the retrieved results, rename the filename and insert into another table with the new filename.
After that delete it from the original table.
But i got this error "There is already an open DataReader associated with this Command which must be closed 1st".
How can i overcome this?can anyone help me on this? I'm out of ideas. Thanks and appreciate...
Here is my code:-
cmd.Connection = cn
cn.Open()
tn = cn.BeginTransaction
cmd.Transaction = tn
strQuery2 = "SELECT FileName,FileSize FROM udtTempAttach where UniqueID = '" & Me.lblUniqueID.Text & "'"
cmd.CommandText = strQuery2
dr2 = cmd.ExecuteReader
Try
Do While dr2.Read
filename = Replace(dr2(0).ToString, ".", "_" & DistID & ".")
filesize = dr2(1).ToString
FileIO.FileSystem.CopyFile(ServerPath + "TempAttach\" + dr2(0).ToString, ServerPath + "Attachment\" + filename, True)
If FileIO.FileSystem.FileExists(ServerPath + "Attachment\" + filename) Then
FileIO.FileSystem.DeleteFile(ServerPath + "TempAttach\" + dr2(0).ToString)
End If
strQuery3 = "INSERT udtAttachment (DistID,FileName,FileSize,EnterDate) "
strQuery3 = strQuery3 & " values('" & DistID.ToString & "','" & filename.ToString & "','" & filesize.ToString & "',getdate()) "
cmd.CommandText = strQuery3
ra = cmd.ExecuteNonQuery()
strQuery3 = "Delete from udtTempAttach where UniqueID='" & Me.lblUniqueID.Text & "' and filename = '" & dr2(0).ToString & "'"
cmd.CommandText = strQuery3
ra = cmd.ExecuteNonQuery()
Loop
dr2.Close()
Catch ex As Exception
MsgBox(ex.Message)
dr2.Close()
tn.Rollback()
Finally
If cn.State = ConnectionState.Open Then cn.Close()
End Try
.......Thanks.......
|
|
|
|
|
Eunice (VB junior) wrote: There is already an open DataReader associated with this Command which must be closed 1st".
Use a different command object to do insertion and deletion. This error is coming because DataReader is still active and you can't use the command for other queries until you close reader. Your queries are open to SQL Injection attacks. Read about it and change to parametrized queries.
|
|
|
|
|
The error message means what it says. Also, your code looks to be very insecure. Do you know what a SQL injection attack is ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Any hint to overcome the SQL injection attack? Thanks in advanced.....
|
|
|
|
|
Eunice (VB junior) wrote: Any hint to overcome the SQL injection attack
First hint is to use Google. This[^] was my first hit when I searched.
|
|
|
|
|
thanks..... I'm doing it now.
|
|
|
|
|
Hi friends!!!!!!
I want to create the Code Project's Massage board like treeview.
How can I implement it?
Please help me.
|
|
|
|
|
Do what they did. Hire people who know ASP.NET and have them write some code.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi Graus,
Thanks for your reply.
Actually, I am creating a site where user can post message or reply to it just like code project.
I want to display the messages in just Code Project's message board like tree view structure.
If you help me I will be grateful.
With Regards,
Samrat
|
|
|
|
|
Hi guys
I have a custom control with a template which basically just acts as a placeholder for controls. Here is example code for how to use the control:-
<cc1:DropDown ID="DropDown1" runat="server">
<DropDownContentsTemplate>
<div>
<asp:CheckBoxList ID="CheckBoxList1" runat="server" OnSelectedIndexChanged="CheckBoxList1_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="First Option" Value="1"></asp:ListItem>
<asp:ListItem Text="Second Option" Value="2"></asp:ListItem>
</asp:CheckBoxList>
</div>
</DropDownContentsTemplate>
</cc1:DropDown>
As you can see the DropDownContentsTemplate is just a placeholder for adding controls. And I've added a CheckBoxList control. The OnSelectedIndexChanged is set a an event in the code-behind and AutoPostBack is set to true, so that it'll postback when the user selects a checkbox. However the event doesn't fire for some reason. I'm assuming there's something special that I need to do with the template. Could someone please tell me what I am missing in order to fire the OnSelectedIndexChanged event.
Thanks
|
|
|
|
|
threemp3 wrote: there's something special that I need to do with the template.
It depends on how you render the template.
threemp3 wrote: However the event doesn't fire for some reason
Look into the page source and see how the checkbox list is rendered. Compare it with another checkbox list which is not in the template.
|
|
|
|
|
Hi all when im trying to create a new ASp.Net web appication im getting the error
"The web server reported following error when attempting to create a web project located at the following URL 'http://localhost/Webappicatiion1'.
'Http/1.1 500 server Error'
Whta will be the problem with this
Thanks in advance for any help
|
|
|
|
|
reogeo2008 wrote: 500 server Error'
Look here[^] and see what HTTP 500 error code means. It is internal server error. Is your IIS up and running?
|
|
|
|
|
how can i check whether my IIS up and running or not.
My VS 2005 application work fine
|
|
|
|
|
Take browser and type http://localhost and it should open the default website or IIS welcome page. If it appears, your IIS is running. BTW, why are you creating project on IIS other than using the inbuilt ASP.NET development server? For using it, choose the file system type project.
|
|
|
|
|
Whn i open http://localhost im getting the error Page can not be dispalyed.What will be exactly happening
|
|
|
|
|
your IIS is not running.... if you are still on developing phase, try to run ur web project in Visual Studio IDE, i'm sure it will create a virtual IIS.... somthing like "http://localhost:1234/default.aspx"....
xxx
|
|
|
|
|
In my aspx form, I have an HTML table which contains rows and columns (tr and td). In one of the row, I have one label control and one text box and in another row I have another label control and a drop-downlist containing data.
My requirement is, on runtime, I need to make these rows visible and hidden based upon some conditons. I know that by giving an id to the row it can be achieved. But how it should be coded in codebehind? Any idea on this? Or is there any other better way of doing this? Can anybody please provide any help on this?
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|