|
<asp:GridView ID="GridView1" runat="server" BackColor="#DEBA84" BorderColor="#DEBA84"
BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Total" Enabled="False" Height="278px" Width="515px" Font-Size="Large" OnRowDataBound="GridView1_RowDataBound" >
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:TemplateField HeaderText="Article Subject">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" Font-Underline="True" Text='<%# Eval("TA_VC50_ArtName") %>' ForeColor="Purple" Visible="<%# true %>" PostBackUrl="default1.aspx"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Author">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("TA_VC50_ArtAuthor") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="marks">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Total") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle Font-Size="Large" />
</asp:GridView>
</td
|
|
|
|
|
anujbanka1784 wrote: Visible="<%# true %>"
What the hell is this ?
Define 'not working'. What is happening ? I am assuming the Text is not evaluting properly. Perhaps you need to use <%= ? I'm never sure, I just try different ones until it works...
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hai,
i am doing crm project.i upload the database, file and data in new server path.but old server working fine.it export csv file .but new server display error.what can i do ?if you know answer replay to me....
Thank you...!
|
|
|
|
|
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.
|
|
|
|