Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

valerian precop

@valerian precop
About
Posts
13
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Ajax error handlling
    V valerian precop

    Ok... I'm having a problem with Ajax. I don't know if here is the place to ask it, but here it goes... My site uses latest version of Ajax, and Framework 3.5 (c# language)... I am using script manager in the master page. Also the page gets refreshed async, using the Ajax timer control. The task is to hide all the Ajax error alert windows. I tried using the following methods: 1. setting the properties of the ScriptManager: - AllowCustomErrorsRedirect="false" - AsyncPostBackErrorMessage="" 2. Using the ScriptManager event OnAsyncPostBackError="ScriptManager1_AsyncPostBackError" 3. Using the EndRequest: Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest); function endRequest(sender, e) { if(e.get_error()) { e._error.message = ""; e.set_errorHandled(true); } } 4. using the JavaScript window.onerror event The problem is that not all the errors are hidden, and also not always. For example... I have the following scenario: 1. Load the page in IE. 2. Go to page code and delete ";" after one line (create a compilation error). 3. Save the page and wait for the refresh async postback. - the end request event is fired, the original e._error.message is: "Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500." - but the actual alert window that appears automatically has the following message: "An unhandled exception occurred during the execution of the current web request. Compilation error." Also the script manager event OnAsyncPostBackError does not fire. Can someone give me a hand? Thanks, Valy.

    Just call me Valy... :)

    .NET (Core and Framework) help csharp javascript sysadmin tools

  • Exception
    V valerian precop

    SqlConnection conn = new SqlConnection(connectionString); //the sql connection conn.Open(); string strQuery = "insert into Temp(ProductName,Cantity) values ('"+item[0]+"',cast ('"+item[1]+"' as numeric(5,0)))"; //the query SqlCommand com1 = new SqlCommand(strQuery, conn); //the sql command com1.ExecuteNonQuery(); conn.Close(); These is a sample of my code that works just fine. Are you sure the fields in the table are corect... In my sample the table Temp has 2 fields, ProductName is nchar(50) and Cantity is numeric(5,0). Be careful with the " ' " also (string values must be placed between ' in a query otherwise it doesn't work).

    Just call me Valy... :)

    C# csharp database sysadmin

  • populating combo box on selectedindex changedevent of other combo box1
    V valerian precop

    I think I got it. You must use ((DataRowView)comboBox1.SelectedItem).Row["categoryId"].ToString() instead of comboBox1.selectedValue

    Just call me Valy... :)

    C# csharp

  • Index was out of range [modified]
    V valerian precop

    Imran Khan Pathan is right... I didn't see it the first time but you are doing something like these You have a "for" that walks through the listBox2 elements and sees which is selected...then you make a query in the database (inside that "for") and you bind the result of the query with the same listBox2...these alters the containt of the listBox2 and the for is not working anymore (ListBox2.Items.Count is not the same after you have done the binding in the "for" statement and also the ListBox2.Items are changed)

    Just call me Valy... :)

    ASP.NET help database css mysql sysadmin

  • calculate infinite precision
    V valerian precop

    From what I know :) there is no way to calculate infinite precision with out loosing any decimal You may want to take a look at these data types The nearest datatypes you can use are float, double and decimal.

    Just call me Valy... :)

    ASP.NET question

  • Index was out of range [modified]
    V valerian precop

    I'm not sure exactly but you might take a look at "SELECT * FROM myTable where Professions = 'ListBox2.Items(i).Text' " shouldn't these be something like "SELECT * FROM myTable where Professions = '" + ListBox2.Items(i).Text + "' " (I used string concatenation from c# I'm not so good with VB :) ) Tell me if it worked... :)

    Just call me Valy... :)

    ASP.NET help database css mysql sysadmin

  • populating combo box on selectedindex changedevent of other combo box1
    V valerian precop

    It would be more helpful if you could put some code also...

    Just call me Valy... :)

    C# csharp

  • Exception
    V valerian precop

    why do you use those two parameters @p1 and @p2 when you can simply do something like this: string sql = "INSERT INTO tblPassages (column_num, row_num) VALUES ('" + item[0] + "','" + item[1] + "')"; I presume that column_num and row_num are string values in the database. Usually you use parameters when you use a stored procedure to execute a query. So you don't need these lines SqlParameter p1 = new SqlParameter("@p1", item[0]); SqlParameter p2 = new SqlParameter("@p2", item[1]); cmd.Parameters.Add(p1); cmd.Parameters.Add(p2); p1.SqlDbType = SqlDbType.VarChar; p2.SqlDbType = SqlDbType.VarChar; Tell me if it helped... :)

    Just call me Valy... :)

    C# csharp database sysadmin

  • For and next loop... problem
    V valerian precop

    I don't use VB very much but from what I know in C# if you use something like ListBox1.SelectedItem[i] it would not work. ListBox1.SelectedItem[i] returns a ListItem this one has a Text and a Value property. I think you should use something like ListBoxUpgrade.SelectedItem(i).Text Hope it helps...

    Just call me Valy... :)

    C# database help question

  • Exception
    V valerian precop

    listbox1.items returns a ListItemCollection (you must use System.Collections), it doesn't return a string array. foreach(ListItem item in listbox1.items) { string sText = item.Text; string sValue = item.Value; // some code } Regards.

    Just call me Valy... :)

    C# graphics help

  • how to read Mobile no digit by digit?
    V valerian precop

    I think you could use the textBox1_KeyDown(object sender, KeyEventArgs e) event for your textbox...here you have e.KeyCode and other more properties that can help you very much.

    Just call me Valy... :)

    C# tutorial question

  • Populating DropDownList from XML?
    V valerian precop

    Here is one method you could use: 1. create a "ListItemCollection" (eg. lstAllNodes) object and populate it with all the pair values (StateCode,CountyName) from your XML (the text should be StateCode and the value should be CountyName). 2. After that you should do something like this protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { string sText = DropDownList1.SelectedItem.Text; ListItemCollection lstCountyName = new ListItemCollection(); foreach (ListItem lstTempItem in lstAllNodes) { if (lstTempItem.Text == sText) { lstCountyName.Add(lstTempItem); } } DropDownList2.DataSource = lstCountyName; DropDownList2.DataBind(); } Where: -lstAllNodes is the ListItemCollection object populated with all the nodes like I said at 1. -DropDownList1 is your first drop down list with StateCodes (be carefull to have it runat server and set AutoPostBack="true" so that the SelectedIndexChanged event may trigger) -lstCountyName is a second ListItemCollection (it is a temporary object and it's empty at first) it's used to bind the second drop down list with the required values -DropDownList2 your second drop down list with CountyNames

    Just call me Valy... :)

    ASP.NET xml help tutorial question

  • binding data to datagrid
    V valerian precop

    Here is a databind for a grid view in windows application: //... SqlConnection conn = new SqlConnection(connectionString); conn.Open(); string strQuery = "SELECT * FROM tableTest"; SqlCommand com1 = new SqlCommand(strQuery, conn); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(com1); da.Fill(ds, "table"); dataGridView1.DataSource = ds; dataGridView1.DataMember = "table"; //... I hope it works...it worked when I've tested it :)

    ASP.NET wpf wcf question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups