 |
|
 |
protected void FetchDataForPriceHouses1(string city,string loc) { ddlPriceHomes.Enabled = true; string queryString = "SELECT DISTINCT Price FROM tblPropertyDetail WHERE (Price <= 4500000) AND (City = @city) AND (PropertyLocation = @loc) )"; SqlConnection connection = new SqlConnection(ConS); SqlCommand command = new SqlCommand(queryString, connection); command.Parameters.AddWithValue("@city", city); command.Parameters.AddWithValue("@loc", loc); connection.Open();
DataTable dt = new DataTable(); SqlDataAdapter ad = new SqlDataAdapter(command); ad.Fill(dt); if (dt.Rows.Count > 0) {
ddlPriceHomes.DataSource = dt; ddlPriceHomes.DataTextField = "Price"; ddlPriceHomes.DataValueField = "Price"; ddlPriceHomes.DataBind(); } connection.Close();
}
protected void DropDownListLocationHomes_SelectedIndexChanged(object sender, EventArgs e) { //FetchDataForPriceHouses1(); FetchDataForPriceHouses1(Convert.ToString(DropDownListCityHomes.SelectedItem), Convert.ToString(DropDownListLocationHomes.SelectedItem)); }
i am trying this but this error is occured each time.
Server Error in '/cpn' Application. --------------------------------------------------------------------------------
Incorrect syntax near ')'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near ')'.
Source Error:
Line 134: DataTable dt = new DataTable(); Line 135: SqlDataAdapter ad = new SqlDataAdapter(command); Line 136: ad.Fill(dt); Line 137: if (dt.Rows.Count > 0) Line 138: {
Source File: f:\c#Projects\cpn\home.aspx.cs Line: 136
Maifs
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
how can i create a rich textbox in my web?
as it is when when do a thread in it. and send into th database and retrieve it from there?
Maifs
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello guys I have following function to get the list of email address from the database. When i pass this list to mail message BCC function in gives me the error which i have mentioned in subject. Please help me out public void getEmailtoUsers() { DataTable getemailList = news.getEmailList(); foreach (DataRow objDr in getemailList.Rows) { emails += objDr["Email"].ToString() + ";";
} emails = emails.Substring(0, (emails.Length - 1));
}
// email sending function applicant.From = new MailAddress("support@supportimrankhan.org", "Support Imran Khan"); applicant.To.Add(new MailAddress("imran.hamid@supportimrankhan.org", "Imran Hamid")); applicant.Bcc.Add(new MailAddress(emails));
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I have a problem with dropdown. i cant get the value chosen from the list.
here is my code :
ArrayList list = new ArrayList(); list.Add("RAD"); list.Add("RA"); list.Add("R"); list.Add("N");
dropAssetTypes.DataSource = list;
dropAssetTypes.DataBind();
and i take the value like this:
TextBox1.Text = dropAssets.SelectedItem.ToString();
or
TextBox1.Text = dropAssets.SelectedItem.Value;
or
TextBox1.Text = dropAssets.SelectedItem.Text;
or
TextBox1.Text = dropAssets.SelectedValue.ToString();
but...the value appeared is still the first index(it is RAD)...
please help me, how to show the index chosen..???
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Dear friends
In my application grid view is there in that some records will be there,a select button is there if user clicks that button user is redirected to another page all the information willl be displayed in the form
this is the requirement
it is redirecting into another page i have wrote an event that when user clicks event will be fired i have assigned all the row information into the data table, i didnot know how to assign each column value to labels
please anyone helpme how to handle
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I need to write a a text file 3 lines , first 2 lines at teh very top and last line at the verry bottom. The code below will work , but i have to re-open the file the second time to write the last line and idea how i can open 1 time and write all 3 line at the same time
Thanks in advance
example:
top line 1 << write this line top line 2 << write this line ................. ................. ................. ................. Bottom line << write this line
here is current code FileStream txtFile = new FileStream(file_name, FileMode.Open, FileAccess.Write); StreamWriter irheader = new StreamWriter(txtFile); irheader.Write("top line 1"); irheader.Write("\r\n"); irheader.Write("top line 2"); irheader.Write("\r\n"); irheader.Close(); //Reopen the same file and write the 1 line at the very bottom StreamWriter fwriter = File.AppendText(file_name); fwriter.Write("\r\n"); fwriter.Write("Bottom line"); fwriter.Close();
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
hello, I have a window application where I login in a site which have i login name & password through vb.net I do all the this to see the name & id of login, password & submit buttonfield from html source. Now i have problem I have a site where login & password has id & name that i provide frequently. but on submit this is an image & calling javascript fuction so i can not find out id of submit image. tell how can i find out id of submit & how to pass it in our code.
Please give me faverable response thanks
Piyush
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello frenz, I am trying to modify the template itemized hyperlink on my GridView. My problem is , I have 3 types of status, 'KIV','Complete'&'Incomplete'. I must display 'KIV' in Red color font with its coresponding linkA. As for 'Complete', it has to be in 'Green' and matched to linkB. the 'Incomplete' status should beshown in Black color fontand linked it with linkC.
To do this, i used the following method :
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim hLink As String = DataBinder.Eval(e.Row.DataItem, "STATUS").ToString() If hLink.Equals("KIV") Then
Dim hLnk As HyperLink = CType(e.Row.FindControl("UW Status"), HyperLink) hLnk.ForeColor = Drawing.Color.Red hLnk.NavigateUrl = "linkA.asp?AppId=" + DataBinder.Eval(e.Row.DataItem, "APP_ID").ToString()
ElseIf hLink.Equals("Complete") Then
Dim hLnk As HyperLink = CType(e.Row.FindControl("UW Status"), HyperLink) hLnk.ForeColor = Drawing.Color.Green hLnk.NavigateUrl = "linkB.asp?AppId=" + DataBinder.Eval(e.Row.DataItem, "APP_ID").ToString()
Else
Dim hLnk As HyperLink = CType(e.Row.FindControl("UW Status"), HyperLink) hLnk.ForeColor = Drawing.Color.Black hLnk.NavigateUrl = "linkC.asp?AppId=" + DataBinder.Eval(e.Row.DataItem, "APP_ID").ToString()
End If End If End Sub
Problem is, im getting error when i execute the web site.The error description is 'Object reference not set to an instance of an object.' Plz someoen help me sort it out what is the error with my coding.Realy appreciated.
thanks & regards dev
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
A new version of the ITCN ASP.NET Enterprise Forum is now available!
The ITCN ASP.NET Enterprise Forum is a powerful Forum and Discussion Board for your website, built with search engine optimization in mind. Programmed in VB.NET for the Microsoft® .Net 2.0 Framework, the forum software will work on just about any Windows web server with .NET and SQL Server installed. And since it's fully customizable, you can add it to just about any website or blog -- Try it out right now!
First released in 2004, the forum has been newly upgraded in 2007 to provide all the features you have come to expect and need in a discussion board, without all the complexity and difficulty of administration. It is flexible enough to be completely themed to match the look and feel of your website.
Our newest edition is a complete table-less CSS design in XHTML with a focus on search engine optimization, to insure that your website's forum will get noticed, get more traffic, and get more people talking!
|
| Sign In·View Thread·PermaLink | 1.00/5 (2 votes) |
|
|
|
 |
|
 |
This is nothing but an advertisement. I can just count the number of exclamation points in it to figure that out.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Well, yes, it is an advertisement, that is true. I'm the one who write this code and this article, and I'm advertising my own new version of the forum for anyone interested, so I think I'm entitled to one little shameless plug
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Understood. Just a suggestion, you might want to mention that the new version is not open source like the one in the article. BTW, the new one looks heads and tails better than the old one.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
LOL, thanks, good idea! Yeah, that's what happens when you throw a few bucks at a designer .. But the newest version, 3.1, is coming out this month. It won't be open source, but it will be free to download and use, the only restriction being a link back to my website. If you see it doing anything in particular you're interested in (URL rewrites, PDF conversion, etc.), I would be happy to share that part of the code, maybe even make another article about it.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hello there,
I want to do localization for asp page which contains only description(means long text about 15-20 lines) just like informative page. Is there any method in ASP.NET 1.1 which can localize it in any language?
Thanks in adavance.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
hi i have a datagrid in my site. and the datagrid lists user message. and i want to add an edit button in my datagrid to show side users message. if the user is online and looks at the datagrid list, the button is visible but only next to his message. in the code i have written, whenever the user is online the button becomes visible all messages. but i want it visible only for the member's message. how can i make the button visible only next to his message
my code
Dim ara As DataGridItem For Each ara In dtlchar.Items
Dim duzelt As Button duzelt = CType(ara.Cells(0).FindControl("duzelt"), Button) If (Not duzelt Is Nothing) Then Dim bul As New SqlCommand("select uname from users where uname = @p1 ", bag) bul.Parameters.Add("@p1", SqlDbType.NChar).Value = Session("uye") bag.Open() Dim tut As String tut = bul.ExecuteScalar bag.Close() If (Not tut Is Nothing) Then duzelt.Visible = True Else duzelt.Visible = False End If End If Next
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
hi sir i need to login programattically and scrapping data from a website which is the next page after login . for this i m using html agility pack. i m using the link http://www.dotnetjunkies.com/WebLog/joshuagough/archive/2006/01/20/134825.aspx as reference . for trial i m trying to login in gmail and code is as following........................ using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { FormProcessor p = new FormProcessor(); string userName = "*****************"; string password = "******************"; Form form = p.GetForm("https://Gmail.com","//form@name='loginForm'", FormQueryModeEnum.Nested); form"j_username".SetAttributeValue("value", userName); form"j_password".SetAttributeValue("value", password); HtmlDocument doc = p.SubmitForm(form); string strBal = doc.DocumentNode.SelectSingleNode ("//span@class='redText'").InnerText; strBal = System.Web.HttpUtility.HtmlDecode(strBal); strBal = strBal.Substring(1).Trim(); } }
in which i m facing problem in xpath //form@name='loginForm' the error is node not found. i want to know that how can i compose the xpath for any website . plz tell me complete reference about it.
thanks in advance
sharad soni
sharad soni
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I am new to ASP.NET Following is my error:-
Default.aspx located at the folder hc, clsCommon.vb Class is located at the hc/App_Code sub folder, using visual studio 2005 it is working, no problem, when I put it in to my web server (IIS) it gives following error, Cant understand why? I think I don't know the code to tell to the ASP .NET page to find classes from App_Code
Error the browser output to me:-
Server Error in '/HC' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'clsCommon' is not defined.
Source Error: Line 8: Line 9: Sub LoadDistricts() Line 10: Dim iVal As New clsCommon Line 11: iVal.AddtoList(cboDistrict, "SELECT DistrictAreaCode, DistrictAreaNameS FROM HCtbl_DistAreaCode") Line 12: iVal = Nothing
Want to know HOW I tell to the my default page (default.aspx) to load classes from the folder App_Code? any settings, need help, Thanks in advance
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
I want to host one asp.net website.I have problem when i browse the site.It always shows error as
Server Error in '/' Application. Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
give me the solution asasp
Thanks
Regards Khan
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I got this error with my testing server, then I deleted web.config file then it works, its a testing trick of my, but it is not advisable
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
In reply to the Web.config... You need to make sure this line is set to true:
<compilation debug="true"/>
it's contained within the Web.config file in the root of the project..
Thanks, Carl
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi ,
I want to access the webpage from remote system.How can i do this? Give me the solution.
Thanks
Regards Khan
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi All
Please help me to create a random security code in aspnet
Example: register yahoo mail, gmail:
-> securyti code is a picture : BDCJWMU9
Thank you
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
i'm writing a web application with ASP.NET technology, i want to disday some files with .tif, .pdf and .jpg extension on IE browser, but i don't know how to do it. Could you help me.
Thanks for your regard!
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim data As Byte() = showImage(3) Dim offset As Int32 = 78 Dim mstream As New MemoryStream mstream.Write(data, offset, data.Length - offset) Label1.Text = mstream.Length Dim bmp As New Bitmap(mstream)//err: Invalid parameter used.
/*Error occurs here, when debug, cant save the image */ bmp.Save(Server.MapPath("aple.jpeg"), ImageFormat.Jpeg) mstream.Close() Image1.ImageUrl = Server.MapPath("aple.jpeg") End Sub
showimage() conn//settings Dim dr As SqlDataReader = cmd.ExecuteReader() dr.Read() Dim imgbyte As Byte() = CType(dr("FileData"), Byte()) Return imgbyte
jeneesh | programmer | stellarmultimedia inc | cochin
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |