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
R

RickSharp

@RickSharp
About
Posts
17
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • GridView FindControl LINQ Update
    R RickSharp

    I have resolved this issue by reading an asp lablel key into a dictionary. then if the dictionary had that label insert into my database. Sorry if I was vague but I'm very new to all of this so I mostly i just make others made by asking inane questions that are apparently to unclear to understand. :(

    C# csharp database linq security announcement

  • GridView FindControl LINQ Update
    R RickSharp

    Thanks for the insight. I'll go reread my C# manual... So i read it, and I guess I'm too stupid to understand it. Maybe someone else can help.

    C# csharp database linq security announcement

  • GridView FindControl LINQ Update
    R RickSharp

    The only way I know how to refer to a checkbox in a TemplateField is by using GridViewRow in a foreach loop. If there is another way to find that control then i would love to know.

    C# csharp database linq security announcement

  • GridView FindControl LINQ Update
    R RickSharp

    This link shed a little light, but still confused how to implement it. http://stackoverflow.com/questions/1233916/linq-find-all-checked-checkboxes-in-a-gridview[^]

    C# csharp database linq security announcement

  • GridView FindControl LINQ Update
    R RickSharp

    Hey Guys, I know I can access my ItemTemplated Checkbox this way:

    foreach (GridViewRow rowItem in GridView1.Rows)
    {

    CheckBox ckBxSelect = ((CheckBox)rowItem.FindControl("chkBxSelect"));  
    
    
    // chk.checked will access the checkbox state on button click event  
    if (ckBxSelect.Checked)  
    {  
        Response.Write("True");  
    }  
    

    }

    Ive built 1 LINQ object joined from 2 Datatables which comes from 2 WebServices. My GridView is bound to my LINQ object. When the user clicks submit, a foreach loop inserts that LINQ object into my database like so:

    protected void Button1_Click(object sender, EventArgs e)
    {
    mySQLDatabaseDataContext dbc = new mySQLDatabaseDataContext("Data Source=JBBBZ7V1\\SQLEXPRESS;Initial Catalog=WLSData;Integrated Security=True");

            mySQLTableName newRecord;           
            foreach (var item in LINQobject)
            {
                newRecord = new mySQLTableName();
    
    
                newRecord.CustName = forAppr.custName;
                newRecord.Status = "";          
                newRecord.DateTimeSubmitted = DateTime.Now;
    
                dbc.mySQLTableName.InsertOnSubmit(newRecord);
    
            }
    
            dbc.SubmitChanges();
    

    }

    Like I said, my checkbox is in a TemplateField like so:

                        <HeaderTemplate>
                            </HeaderTemplate>
                         
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
    

    When I am inserting from my LINQ object, I would like the "Status" field to update with "True" if checkbox is checked or "False" if checkbox is not checked. Like so:

    protected void Button1_Click(object sender, EventArgs e)
    {
    mySQLDatabaseDataC

    C# csharp database linq security announcement

  • DataSet to Dictionary Join?
    R RickSharp

    Huor, Thank so much for your time. This is very helpful and at least sends me in the right direction! It seems like most experienced programmers are too jaded to offer help here. Like giving a handout to a poor person that hasn't helped themselves. Like I'm just looking for a handout because I'm too stupid to google or use the "search" features. "Oh please Mr programming constultant, help me for free, please, my family is dying from starvation and and...my dog has fleas...I need more code" "Begone peasant!! I have no time for new coders! I'm solving much higher and more important recursion problems and pointer issues! Why don't you use the search feature." Bah!

    C# tutorial question

  • DataSet to Dictionary Join?
    R RickSharp

    No idea how to achieve all of that. Sorry. Beginner here. But your enthusiasm is, nice.

    C# tutorial question

  • DataSet to Dictionary Join?
    R RickSharp

    Do you mean like this? public class Companies { public static String Company1 { get { return "Company1";}} public static String Company1City { get { return "Company1City";}} public static String Company1State { get { return "Company1State";}} public static String Company2 { get { return "Company2";}} public static String Company2City { get { return "Company2City";}} public static String Company2State { get { return "Company2State";}} } or like this? Public Class Company1 { } Public Class Company2 { }

    C# tutorial question

  • DataSet to Dictionary Join?
    R RickSharp

    Hello all, I have 2 Datasets. I've already asked how to join 2 DataSets and didn't get any answers that helped me. So I feel the easiest way to associate them now is to create a dictionary(s) for DataSet2. The 2 different DataSets have only 1 field in common, CompanyName. So enter dicitonary. DataSet 2 contains only 16 total records (Company). Each record (Company) has 7 rows: Company1 Carrington Mortgage Services, LLC 1610 E. Saint Andrew Place B150 Santa Ana CA 92705 So when CompanyName matches, return value from Dictionary. Do i need to create 16 Dicitonary entires with Key and Value? Do i create 1 Dictionary with variables populating on some kind of for loop? I was told that i could create my own class to store the information I need or simply set the dataset record as the value. No idea what any of those things mean. :(

    C# tutorial question

  • Joining 2 DataSets
    R RickSharp

    Hello all, I have 2 datasets from 2 different Web Services and reading them into DataSets: DataSet dsLoans = new DataSet(); dsLoans.ReadXml(XmlReader.Create(new StringReader(myWLSreference.GetCustomLoanExport2()))); DataSet dsCompany = new DataSet(); dsCompany.ReadXml(XmlReader.Create(new StringReader(myWLSreference.GetCustomCompanyExport2()))); I have done multiple searches and have come across: http://forums.asp.net/t/1708173.aspx/1?how+can+i+inner+join+tables+within+DATASET+[^] http://stackoverflow.com/questions/10502512/c-sharp-datatable-inner-join-with-dynamic-columns?lq=1[^] http://support.microsoft.com/kb/326080/en-us[^] But no joy yet. I have searched and searched. I cant use Datatables because i'm reading the dataset into a List<> with a foreach statement like so:

    foreach (DataRow row in JoinedDataSet.Tables["Loan"].Rows)
    {

           WireEntryLoan newEntryLoan = new WireEntryLoan();
    
           newEntryLoan.custName = row\["MtgeeLoanName"\].ToString();
           newEntryLoan.loanWLSID = row\["LoanNumber"\].ToString();
    

    Then binding that to GridView. How in the world can I join 2 DataSets on a common field?!

    C# wcf csharp asp-net wpf com

  • XML Mapping to CSV
    R RickSharp

    Hmmm Ok. Thanks for the brainstorming. Guess i dont need a dataset at all if XLST can give me both displaying the data in a meaningful manner front end while also being able to convert the data and spitting it out to a file, which it sounds like it can. I look into it until you get back to me. :)

    C# xml

  • XML Mapping to CSV
    R RickSharp

    Actually thats a good question. Because I'm not really wanting the end file to be a CSV file. The end file should be in FedWire Format. http://www.frbservices.org/campaigns/remittance/files/fedwire_funds_format_reference_guide.pdf[^] I just figured it would be easier to get to my end result with a CSV file to work with. Basically I'm taking that Web Service. Iterating through the tables. Then ultimately spitting out a file in that format. {1015} blah blah blah {1870} blah blah blah

    C# xml

  • dropdown issue
    R RickSharp

    IIII

    C# database help

  • XML Mapping to CSV
    R RickSharp

    Actually this might be more what I'm looking for:

    public class WireEntry
    {
    public String Name { get; set; }
    public String Number { get; set; }
    public String BankName { get; set; }
    public String ClosingNo { get; set; }

    public WireEntry()
    {
    }
    

    }

    foreach (DataRow row in ds.Tables["Loan"].Rows)
    {

            // Enter into result set
    
            WireEntry newEntry = new WireEntry();
            newEntry.Name = row\["Name"\].ToString();
            newEntry.Number = row\["Number"\].ToString();
            newEntry.BankName = row\["BankName"\].ToString();
    
            result.Add(newEntry);
    
        }
    
        return result;
    
    C# xml

  • XML Mapping to CSV
    R RickSharp

    Hello, I have a fixed XML table thats coming from a Web Service.

    JOHNSON, DANIEL R.
    BMRES-550
    Bank of America
    123456
    49,7560.8600

    I need to convert the XML data to CSV. The data to be converted has commas. So the below method doesn't work:

    using (StreamWriter writer = File.CreateText("C:\\username\\password\\Desktop\\Export.csv"))
    {
    DataSet ds = new DataSet();
    ds.ReadXml(XmlReader.Create(new StringReader(myWebreference.GetWebServiceMethod("username", "password1", "Export", "Parameter4", DateTime.Today, DateTime.Today, ""))));

            writer.WriteLine(string.Join(",", ds.Tables\["Loan"\].Columns.Cast().Select(col => col.ColumnName).ToArray()));
            foreach (DataRow row in ds.Tables\["Loan"\].Rows)
            {
                writer.WriteLine(string.Join(",", row.ItemArray.Cast().ToArray()));
    
            }
        }
    
    C# xml

  • DataGridView doesn't appear on screen
    R RickSharp

    By entry point do you mean is it just a win form, exe or class library? If so I have added a form project and console application project to my solution. So I have a class library that contains that code. I added a reference to that class library in the new forms and console projects that I created. I tried following this tutorial with no success. http://www.dotnetperls.com/datagridview-tutorial[^]

    C# database csharp linq question

  • DataGridView doesn't appear on screen
    R RickSharp

    Hey guys, Easy one here. I want to see the results of my datatable in the DataGridView. When i execute, it runs without errors but no DataGridView shows up on screen. Does DataGridView require a form to view the results or something? What am I missing?

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using FileHelpers;
    using System.Data; //not used by default
    using System.IO; //not used by default
    using System.Data.OleDb; //not used by default
    using System.Windows.Forms;

    namespace CSVParser
    {
    class CSVParser
    {
    public static DataTable ParseCSV(string path)
    {
    if (!File.Exists(path))
    return null;

            string full = Path.GetFullPath(path);
            string file = Path.GetFileName(full);
            string dir = Path.GetDirectoryName(full);
    
            //create the "database" connection string 
            string connString = "Provider=Microsoft.Jet.OLEDB.4.0;"
              + "Data Source=\\"" + dir + "\\\\\\";"
              + "Extended Properties=\\"text;HDR=No;FMT=Delimited\\"";
    
            //create the database query
            string query = "SELECT \* FROM " + @"C:\\Users\\rsharp\\Desktop\\CustomerExport.csv";
    
            //create a DataTable to hold the query results
            DataTable dTable = new DataTable();
    
            //create an OleDbDataAdapter to execute the query
            OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, connString);
    
            //try
           // {
                //fill the DataTable
                dAdapter.Fill(dTable);
           // }
            //catch (InvalidOperationException /\*e\*/)
           // { }
    
            //the DataGridView
            DataGridView dgView = new DataGridView();
    
            //BindingSource to sync DataTable and DataGridView
            BindingSource bSource = new BindingSource();
    
            //set the BindingSource DataSource
            bSource.DataSource = dTable;
    
            //set the DataGridView DataSource
            dgView.DataSource = bSource;
    
            //Dispoe of the adapter
            dAdapter.Dispose();
    
            return dTable;
        }
    }
    

    }

    C# database csharp linq 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