|
hai,
Thank You.i assign provision on this folder.but still doesn't work .anymore solution you known ?
|
|
|
|
|
Is this URL within your website ? What code is trying to open the file ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hai,
Thank You.this folder inside server.this code is work fine in afxisi.net server.but today i did upload my files,db.data change in afxisi.org server so this server not support.
export csv coding
**********
System.Threading.Thread.Sleep(3000);
StreamWriter sw = new StreamWriter(Server.MapPath("Export\\contacts.csv"));
sw.WriteLine("{0},{1},{2}","Title", "First Name", "Last Name");
if (con.State.ToString() == "Closed") { con.Open(); }
SqlDataAdapter adp = new SqlDataAdapter("select title,firstname,lastname,officephone,mobileno,accountname,homephone,otherphone,fax,title1,department,donotcall,team,assignedto,emailprimary,secondaryemail1,secondaryemail2,secondaryemail3,primaryaddress,primarycity,primarystate,primaycountry,primaypostalcode,secondaryaddress,secondarycity,secondarystate,secondarycountry,secondarypostalcode,description,middlename,suffix,company,jobtitle,businessstreet2,businessstreet3,homestreet2,homestreet3,otherstreet,otherstreet2,otherstreet3,othercity,otherstate,otherpostalcode,othercountry,assistantsphone,businessfax,businessphone,businessphone2,callback,carphone,homefax,homephone2,isdn,pager,primaryphone,radiophone,ttytddphone,telex,aniversary,billinginformation,birthday,businessaddresspobox,categories,children,directoryserver,emailtype,emaildisplayname,email2type,email2displayname,email3type,email3displayname,gender,governmentidnumber,hobby,homeaddresspobox,initials,internetfreebusy,keywords,language,location,managersname,mileage,notes,officelacation,organizationalidnumber,otheraddresspobox,priority,private,profession,sensitivity,spouse,user1,user2,user3,user4,webpage,groupname,status from leads where groupname='" + txtgroupname.SelectedValue+"'", con);
DataSet ds = new DataSet();
adp.Fill(ds);
if (ds.Tables[0].Rows.Count > 0) {
for (int io = 0; io < ds.Tables[0].Rows.Count; io++) {
sw.WriteLine("{0},{1},{2}",ds.Tables[0].Rows[io][0].ToString(),ds.Tables[0].Rows[io][1].ToString(),ds.Tables[0].Rows[io][2].ToString());
}
}
if (con.State == ConnectionState.Open) {con.Close(); }
sw.Close();
string filename = Server.MapPath("Export\\contacts.csv");
Session["filenames"] = filename;
exportframe.Attributes["src"] = "./crmexport.aspx";
if you know any solution replay to me...
|
|
|
|
|
OK, you're sure you're able to set the file permissions on the server ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
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.
|
|
|
|
|
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.......
|
|
|
|
|
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.
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|