
reagan123
Avatar/Signature-
Posts
38 -
Joined
-
Last visited
reagan123's Achievements
Newbie (1/14)
0
Reputation
-
actually it seems to work a bit now... i get the systems message first.. then pops up the message box saying the error has been logged. how would i get it to not show the first message An unhandled exception of type "System.FormatException" occured in mscorlib.dll Break -- Continue -- Help
-
I'm trying to walk through the example at this link for logging unhandled exceptions in the event log. When I run the example and try to get an error, I get the normal error message and my program shuts down... it doesn't log the error. Anyone know what to try to get this to work? thanks Article found here: http://www.quepublishing.com/articles/article.asp?p=31321&seqNum=5
-
i think that may do the trick... i'll give it a shot later, thanks for the suggestion.
-
hmm. not quite my problem. let me try and re-explain. I am populating a combo box from a table called subscriptions. This table has 'subscriptionID' and 'subscription' in the table. I'm putting the 'subscriptionID' field in the combo box value member and putting the 'subscription into the display member. Once that is loaded, i'm pulling a record out of a table that contains 'softwareID', 'softwareName', 'binderID', 'subscriptionID'. I need to make the dropdown box be selected to the value of subscriptionID from this table. Basically, if the record I pull out of the second table has a 'subscriptionID' of 2, then the dropdown box needs to be on the item that has the valuemember of 2. Does that make sense? thanks so far for the help!!
-
ok, should be simple, but i'm having a hard time getting this to work. I have a combo box that is populated with the following. da.Fill(ds, "Subscription"); cboSubscriptions.DataSource = ds.Tables["Subscription"]; cboSubscriptions.DisplayMember = "SubscriptionNo"; cboSubscriptions.ValueMember = "SubscriptionID"; Value Member DisplayMember 1 2323235235 2 3352525233 3 4564564564 etc.... This works fine but once the combo box is populated is where i'm having my trouble. I'm getting some values out of a database table that have the 'SubscriptionID' in it. How can I take the database value and then have the combo box selected based off of that value. If i'm pulling a subscriptionID of '2' out of the database, i need to set the combo box to show 3352525233. thanks.
-
using select method of dataset and binding?
reagan123 replied to reagan123's topic in Database / XML / Reporting
Got it to work using the following. I'm still open to suggestions if there is a better way of doing this. try { // Apply Filter Expression this.dsSoftwareLocations1.Tables["software"].DefaultView.RowFilter = "Software='" + this.cboSoftware.Text + "'"; // Gets the number of records in the DataView after // RowFilter and RowStateFilter have been applied. if (dsSoftwareLocations1.Tables["software"].DefaultView.Count > 0) { dgLocations.DataSource = dsSoftwareLocations1.Tables["software"].DefaultView; } else { MessageBox.Show("Filter criteria does not meet criteria"); } } -
I�m playing around with an ado.net windows form application and ran into a problem. I have a data set that is filled. I�m trying to use the select method on a dataset to filter some records� when I bind the results to the datagrid I�m getting extra columns in the grid like the follosing. HasErrors | RowError | Table | etc� What do I need to do in order to have it display just the columns from the dataset?. Here is the code. Thanks for any suggestions. try { dgLocations.DataSource = this.dsSoftwareLocations1.Tables["software"].Select("Software='" + this.cboSoftware.Text + "'"); // this.dgLocations.DataSource = this.dsSoftwareLocations1.Tables["software"]; } catch(Exception ex) { MessageBox.Show(ex.Message); }
-
multiple stored procedure parameters...???
reagan123 replied to reagan123's topic in Database / XML / Reporting
thanks, that seems to work... is all the other stuff i had initially just extra fluff. is there any reason why i need to specify that info? thanks for the help. -
I am trying to execute a sql server stored procedure from a c# windows app. I need to send it 3 parameters, is this the correct way to do that or am taking the long route. any feedback greatly appreciated! Thanks private void btnUpdate_Click(object sender, System.EventArgs e) { try { string strConnection = ConfigurationSettings.AppSettings["ConnectionString"]; SqlConnection cnn = new SqlConnection(strConnection); SqlCommand objCommand = new SqlCommand("usp_InsertSoftware", cnn); objCommand.CommandType = CommandType.StoredProcedure; SqlParameter objParameter = new SqlParameter("@softwareName",SqlDbType.VarChar, 100); objCommand.Parameters.Add(objParameter); objParameter.Direction = ParameterDirection.Input; objParameter.Value = this.txtSoftware.Text; SqlParameter objParameter1 = new SqlParameter("@binderID",SqlDbType.Int); objCommand.Parameters.Add(objParameter); objParameter1.Direction = ParameterDirection.Input; objParameter1.Value = this.cboBinders.SelectedValue; SqlParameter objParameter2 = new SqlParameter("@subscriptionID",SqlDbType.Int); objCommand.Parameters.Add(objParameter2); objParameter2.Direction = ParameterDirection.Input; objParameter2.Value = this.cboSubscriptions.SelectedValue; cnn.Open(); objCommand.ExecuteScalar(); MessageBox.Show("Software has been added"); cboSoftware.DataSource= null; bindSoftware(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { //clean up } }
-
i know i can use string.replace to find a character and then replace it with another... what if i want to find 2 characters? what is the best thing to use? can this be done with one string.replace() or two of them (one for each character) or is there a better way? i want to be able to remove '&' or '=' from a string. thanks for the insight. //Gets rid of '&' character string test = "This & That"; test=test.Replace("&", " "); Console.WriteLine(test);
-
passed it as a string and it worked.. thanks so much.
-
i'll try to pass it as a string as suggested above... i'll be back with the results :) thanks so much for all of the help.
-
sure.. when i sent 105 i got an error.. this is cut and pasted from the integration guide.. .thanks so much for your patience and help EXPDATE -- Expiration date of the credit card in mmyy format. For example, 0308 represents March 2008. Required=Yes Type=Numeric MaxLength=4
-
ok.. but i need to send an integer value to an api... it's expecting the format to be a four digit integer such as '0105' or '0607' or whatever... how do i get it in that format? any suggestions?
-
man.. still having problems.. .here's the overall picture. I have to drop down lists ddlMonth and ddlYear. ddlMonth is populated like this. <asp:ListItem Value="1">01</asp:ListItem> <asp:ListItem Value="2">02</asp:ListItem> <asp:ListItem Value="3">03</asp:ListItem> ... <asp:ListItem Value="12">12</asp:ListItem> the ddlYear is populated like this. // Set the exp year drop down list values. int currentYear = DateTime.Now.Year - 2000; int finalYear = currentYear + 6; ddlExpYear.Items.Add(new ListItem("", "")); for(int i=currentYear; i<finalYear; i++) ddlExpYear.Items.Add(new ListItem(i.ToString("00"), i.ToString("00"))); What I'm trying to do is to get an int variable that ends up in this format '0205'... I can't seem to do it... I get '205' string month = ddlExpMonth.SelectedValue.Trim(); string year = ddlExpYear.SelectedValue.Trim(); int ExpDate = Int32.Parse(month+year); Please help if possible.