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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
K

kayos592

@kayos592
About
Posts
19
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How do you resume next?
    K kayos592

    If you execute the attached code in SQL Query analyzer you will see what I'm talking about. Basically, if you try a simple select on an INT field where the where condition is looking for Alpha characters it will give you an error. Simply put, the below code is a simple select which causes an error. Now I know I can check values prior to everything but I want it to continue onto the next record in the event that a simple select causes an error instead of just dying. Please let me know if I should elaborate... CREATE TABLE TestTable (Field1 INT) GO DECLARE @Err INT SELECT * FROM TestTable WHERE field1 = 'ABC' SELECT @Err = @@Error IF @Err <> 0 BEGIN PRINT 'Im In Error Handling number 2' END Now what I mean by "it resumes on one but not the other" is for the first error it will go into the error condition and even execute more of the script, however on the simple select error, it will stop right there and progress no further. Hope that clarifies...

    -Kay

    Database sharepoint help question career

  • How do you resume next?
    K kayos592

    CREATE TABLE TestTable (Field1 INT) GO DECLARE @Err INT INSERT INTO TestTable (field1) VALUES (9999999999) SELECT @Err = @@Error IF @Err <> 0 BEGIN PRINT 'Im In' INSERT INTO TestTable (field1) VALUES ('1235456') END SELECT * FROM TestTable WHERE field1 = 'ABC' SELECT @Err = @@Error IF @Err <> 0 BEGIN PRINT 'Im In' INSERT INTO TestTable (field1) VALUES ('1235456') END When executing the above code, you will enter the first @Err condition but not the second. Both errors produce the same Severity level so I'm not sure why it resumes on one but not the other. Is there any way to force an SP to resume next?

    -Kay

    Database sharepoint help question career

  • How to get a Dataset Selected Index number?
    K kayos592

    I have a datagrid whose datasource is a dataset. Dim DiagCmd As DbCommand = db.GetStoredProcCommand("p_Get_All_Diags") Dim dsDiags As DataSet = New DataSet("Diagnostic_Codes") dsDiags = db.ExecuteDataSet(DiagCmd) dgDiags.DataSource = dsDiags.Tables(0).DefaultView The above works..... Now, I want to be able to click a button and move an item from one grid to another... sounds simple enough.... The code to do that is below.... Private Sub btnNxt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNxt.Click dsAuto.Tables(0).Rows.Add(dsDiags.Tables(0).Rows(dgDiags.RowSel - 1).ItemArray) End Sub and this works.... my problem is if I click on the columnheader and change the sort order it will move the item based on how they originally appeared in the grid. ie. if the grid starts with A-Z and I click the header making it Z-A.... if I then click Z(Which is now at the top) and click my btnNxt it will move A. Anybody help is greatly appreciated...

    -Kay

    Visual Basic database help css tutorial question

  • Searching DTS Packages
    K kayos592

    Is there an easy way to search DTS Packages for the text ".exe"?? Any help is greatly appreciated. -Kay

    IT & Infrastructure algorithms help question

  • Basic C# - Object Reference Not Set To Instance of An Object
    K kayos592

    Just thought I'd show you the progress I made based on your suggestions.... It doesn't quite look like the code you suggested (it didn't compile).. but with some minor changes it worked just the same... Thanks for the direction... private void Form2_Load(object sender, System.EventArgs e) { ClientList C = new ClientList(); C.Client[0] = new Client(); C.Client[0].id = 1; C.Client[0].ClientNm = "John Allen"; C.Client[1] = new Client(); C.Client[1].id = 2; C.Client[1].ClientNm = "Michael Thomas"; for (int i=0;i<2;i++) { MessageBox.Show (C.Client[i].id.ToString()); MessageBox.Show (C.Client[i].ClientNm); } } public class Client:ClientList { public int id; public string ClientNm; } public class ClientList { public Client [] Client = new Client[5]; } -Kay -- modified at 19:51 Saturday 13th May, 2006

    C# help csharp data-structures question

  • Basic C# - Object Reference Not Set To Instance of An Object
    K kayos592

    I have no problem being told to read books... but if that's all you put in the post. Then it has an insulting demeanor. If it's accompanied by help...it feels different. That's just my opinion... As for your comments. I agree.... the Patient Class would've been better named as PatientList. You go on to say create a class to maintain another class's array Information. If I'm not mistaken the Code would looks something like PatientList.Patient.id[0] Either way, I thought you might find this funny.....sometimes "Hello World" isn't such a bad thing. Sometimes it makes the most sense.... -Kay

    C# help csharp data-structures question

  • Basic C# - Object Reference Not Set To Instance of An Object
    K kayos592

    Mav, Do you understand what I've done? I now understand what static means(and it appears I understand it better than you) and it's not consistent with your statement. Allow me to enlighten you... private void Form1_Load(object sender, System.EventArgs e) { Patient.id[0] = 1; Patient.Lname[0] = "Smith"; Patient.Fname[0] = "John"; Patient.Mname[0] = "Allen"; } public class Patient { public static int[] id = new int[5]; public static string[] Lname = new string[5]; public static string[] Fname = new string[5]; public static string[] Mname = new string[5]; } This code means that I can have up to 5 values for each property in that class. This means I can write: Patient.id[1] = 1; Patient.Lname[1] = "Smith"; Patient.Fname[1] = "John"; Patient.Mname[1] = "Allen"; Patient.id[2] = 1; Patient.Lname[2] = "Barker"; Patient.Fname[2] = "Dave"; Patient.Mname[2] = "Barry"; Patient.id[3] = 1; Patient.Lname[3] = "James"; Patient.Fname[3] = "Rick"; Patient.Mname[3] = "Franklin"; Patient.id[4] = 1; Patient.Lname[4] = "Jones"; Patient.Fname[4] = "Paul"; Patient.Mname[4] = "Alexander"; And anytime I call my: private void ShowPatient(int id) { txt1.Text = Patient.id[id].ToString(); txt2.Text = Patient.Lname[id]; txt3.Text = Patient.Fname[id]; txt4.Text = Patient.Mname[id]; } It will populate the correct patient based on the id being passed in. Hope that helps you understand it better... Also, Please don't HELP demean people by telling them to go read books. You don't know how many books that person has in front of them when they actually ask for help. You want to place an article...that's fine... but it appears that not everyone who says "Read Books" knows the answer. Truth is... I think "Read Books" is an easy way to not answer the question. This forum is for help... I respectfully ask that you save comments like that for yourself so that valueable messageboard threads aren't wasted on "Go Read a Book" replies... However, I do appreciate your willingness to aid. This is why I'm sharing my findings with you... -Kay

    C# help csharp data-structures question

  • Basic C# - Object Reference Not Set To Instance of An Object
    K kayos592

    The variable is initialized and populated correctly. The value is 0 because the value is not carrying over through my application. Declaring it as static fixed this as my initilizing and value assigning was not only valid to the local procedure. Maybe I'm not the one who needs to read books here because I challenge you to make it work without using static. P.S.--Don't waste your whole day on it... it's not that big a deal... I'm just trying to prove a point. -Kay

    C# help csharp data-structures question

  • Basic C# - Object Reference Not Set To Instance of An Object
    K kayos592

    Thank you, you're right...that's an excellent article... -Kay

    C# help csharp data-structures question

  • Basic C# - Object Reference Not Set To Instance of An Object
    K kayos592

    got it...Here is the functioning code for all those who can benefit from the knowledge... Keep in mind it's just the basic functions and class.... I'm not including all the event... you'll have to fill in the holes... private void Form1_Load(object sender, System.EventArgs e) { Patient.id[0] = 1; Patient.Lname[0] = "Smith"; Patient.Fname[0] = "John"; Patient.Mname[0] = "Allen"; } public class Patient { public static int[] id = new int[5]; public static string[] Lname = new string[5]; public static string[] Fname = new string[5]; public static string[] Mname = new string[5]; } private void ShowPatient(int id) { txt1.Text = Patient.id[id].ToString(); txt2.Text = Patient.Lname[id]; txt3.Text = Patient.Fname[id]; txt4.Text = Patient.Mname[id]; } -Kay -- modified at 0:28 Friday 12th May, 2006

    C# help csharp data-structures question

  • Basic C# - Object Reference Not Set To Instance of An Object
    K kayos592

    lol..ok, is there anyone ELSE that can help me. I know I'm close and I got this far by using books....but I'm taking it beyond what the book example is and that's why I'm on this forum. If anyone can share the knowledge to address this basic problem, I'd greatly appreciate it. Thank you anyway Alex... I'll be sure to share the answer with you once I figure it out. -Kay

    C# help csharp data-structures question

  • Basic C# - Object Reference Not Set To Instance of An Object
    K kayos592

    Interestingly I just figured it out prior to your posting...HOWEVER....now, I'm having problems accessing the values... I'm checking the values in my immediate window and they are populating fine.... I have a function that I'm passing a parameter (the id) so I can produce the correct values in my testbox.... (see code below).... However, I'm not getting an error....I'm just getting a 0 in my first field....any help is greatly appreciated.... private void ShowPatient(int id) { Patient PatientData = new Patient(); txt1.Text = PatientData.id[id].ToString(); txt2.Text = PatientData.Lname[id]; txt3.Text = PatientData.Fname[id]; txt4.Text = PatientData.Mname[id]; } Thank you again... -Kay

    C# help csharp data-structures question

  • Basic C# - Object Reference Not Set To Instance of An Object
    K kayos592

    private void Form1_Load(object sender, System.EventArgs e) { Patient PatientData = null; PatientData.id[0] = 0; //**ERROR PRODUCING LINE PatientData.Lname[0] = "Smith"; PatientData.Fname[0] = "John"; PatientData.Mname[0] = "Allen"; } public class Patient { public int[] id = new int[5]; public string[] Lname = new string[5]; public string[] Fname = new string[5]; public string[] Mname = new string[5]; } The above code produces "Object Reference not set to an instance of an object". I simply want to be able to put 5 values in each variable array. I'm having problem with the first one. Can anyone help? P.S.- The code compiles fine... -Kay -- modified at 23:20 Thursday 11th May, 2006

    C# help csharp data-structures question

  • DataGrid in ASP.NET App Using C#
    K kayos592

    Im having problems updating my grid. The grid loads fine, the edit button functions fine(bringing up textboxes)...I update the data....click "Update" and it reloads the grid. I think this is caused because my form load reloads the grid again but I can't seem to get my grid to show unless I do this. Attached is my form load and update statement....(ps. it enters my update function but the text value is the pre-updated value) public void Page_Load(Object sender, EventArgs e) { _sqlStmt = "SELECT Nm as [Name], OfficeNm as [Office Name], HomePhone as Home, OfficePhone as Office, Address FROM contacts"; oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = c:\\db.mdb"; oleDbDataAdapter1.SelectCommand.CommandText = _sqlStmt; dataSet1.Clear(); oleDbDataAdapter1.Fill(dataSet1, "Contacts"); BindGrid(); } void BindGrid() { Trace.Write ("**IN_BindGrid"); MyDataGrid.DataSource = dataSet1.Tables["Contacts"].DefaultView; MyDataGrid.DataBind(); } public void MyDataGrid_Update(Object sender, DataGridCommandEventArgs e) { Trace.Write ("**In_MyDataGrid_Update"); // For bound columns the edited value is stored in a textbox, // and the textbox is the 0th element in the column's cell string Name = ((TextBox)e.Item.Cells[1].Controls[0]).Text; string OfficeNm = ((TextBox)e.Item.Cells[2].Controls[0]).Text; string Home = ((TextBox)e.Item.Cells[3].Controls[0]).Text; string Office = ((TextBox)e.Item.Cells[4].Controls[0]).Text; string Address = ((TextBox)e.Item.Cells[5].Controls[0]).Text; // Perform the update. //sqlDataAdapter1.Update(ds); oleDbDataAdapter1.Update(dataSet1); // Reload the grid. BindGrid(); } Any help is greatly appreciated.... -Kay -- modified at 23:13 Saturday 6th May, 2006

    C# csharp css asp-net database debugging

  • Crystal Reports
    K kayos592

    Hello All... Ok, here is the situation. We have a stored procedure which creates a User Temp table... ie. user1.FinalTable We then have a crystal report which has a db query in it that accesses this user tables. This worked fine for 6months[where crystal would automatically select the user table of the user who ran the report] ie. user bowser would have his data display from bowser.FinalTable. However, NOW, the report is pulling up the first person with that user table in an alphabetical order. ie. if user bowser runs the report.... his table bowser.FinalTable is created...but the data in the report is from alpha.FinalTable. If we delete alpha.FinalTable he would then get the data from america.FinalTable (again...this is alphebetical). Anybody have any idea why this is happening? The DBA's swear that nothing changed on the server but I think something in the permission realm changed causing this change in the report behavior. -Kay

    IT & Infrastructure database sysadmin question

  • error while inserting user to database
    K kayos592

    So how did you fix it? For everyone's knowledge?(besides the encryption). -Kay

    Visual Basic database data-structures help

  • error while inserting user to database
    K kayos592

    Try MD5_STRING() instead of MD5()... Also, replace the double quotes in your statement with single quotes.... Let me know if that does it... -Kay

    Visual Basic database data-structures help

  • Custom Control - Only able to use one instance of it
    K kayos592

    I have a custom control that I created. It's a multicolumn combobox. It works great. My only problem is that I can only use ONE on my form. When I add a second instance of the control it will not do anything....only ONE will work. Anybody have an idea why that is? -Kay

    Visual Basic help question

  • How to save & retrieve photos in a database
    K kayos592

    In the past I would usually store the image NAME (ie. in a "Image_PathFileName" field. This way when I run through my recordsets I can retrieve the image by pulling the Image_PathFileName value and plugging it into my code..... -Kay

    Visual Basic tutorial csharp database help
  • Login

  • Don't have an account? Register

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