Click here to Skip to main content
15,885,278 members
Home / Discussions / C#
   

C#

 
QuestionHandle transaction without deadlock Pin
Member 106619971-Dec-15 4:25
Member 106619971-Dec-15 4:25 
AnswerRe: Handle transaction without deadlock Pin
Eddy Vluggen1-Dec-15 4:55
professionalEddy Vluggen1-Dec-15 4:55 
QuestionTimelineTool WPF C# Help Pin
Member 121189591-Dec-15 3:47
Member 121189591-Dec-15 3:47 
AnswerRe: TimelineTool WPF C# Help Pin
Pete O'Hanlon1-Dec-15 4:01
mvePete O'Hanlon1-Dec-15 4:01 
SuggestionRe: TimelineTool WPF C# Help Pin
Matt T Heffron1-Dec-15 8:06
professionalMatt T Heffron1-Dec-15 8:06 
QuestionJamaa SMPP: A connection attempt failed because the connected party did not properly respond Pin
Jassim Rahma1-Dec-15 0:38
Jassim Rahma1-Dec-15 0:38 
AnswerRe: Jamaa SMPP: A connection attempt failed because the connected party did not properly respond Pin
Richard Deeming1-Dec-15 0:44
mveRichard Deeming1-Dec-15 0:44 
QuestionNeed help with regards to datagridview Pin
Tbweri30-Nov-15 15:31
Tbweri30-Nov-15 15:31 
OleDbCommand cmd = new OleDbCommand();
cmd.CommandType = global::System.Data.CommandType.Text;
cmd.CommandText = "SELECT * FROM Table1 WHERE RFID = '" + textBox1.Text + "'"; 
cmd.Connection = myCon;
this.table1TableAdapter.Adapter.SelectCommand = cmd;
this.table1TableAdapter.Adapter.Fill(mdb11DataSet.Table1); 



dgvConnect = new NominalRollDBConnection();
conString = Properties.Settings.Default.NominalRollCS;
dgvConnect.connection_string = conString;
dgvConnect.Sql1 = "SELECT * FROM NominalRoll WHERE RFID = '" + textBox1.Text + "'";
ds = dgvConnect.GetConnection1;
 this.nominalRollTableAdapter.Fill(nominalRollDataSet.NominalRoll);


// my connection class

class NominalRollDBConnection
    {
        private string strCon;
        private string sql_string1;
       
        System.Data.SqlClient.SqlDataAdapter da_1;


        public string Sql1
        {
            set { sql_string1 = value; }

        }


        public string connection_string
        {
            set { strCon = value; }
        }


        public System.Data.DataSet GetConnection1
        {
            get
            { return MyDataSet1(); }

        }

     
private System.Data.DataSet MyDataSet1()
{

System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(strCon);
con.Open();
da_1 = new System.Data.SqlClient.SqlDataAdapter(sql_string1, con);

System.Data.DataSet dat_set = new System.Data.DataSet();
 System.Data.DataTable dat_table = new System.Data.DataTable();
da_1.Fill(dat_set, "Table_Data_1");
con.Close();
return dat_set;
}






I have a difference in output when using datagridview to display my data tables.

For the code above it outputs as per my query.

However for the second code it outputs the entire data table, can anyone please explain ?

Thank you Smile | :)


edit: I have binded the datagridview using the GUI for the code above and below to respective datasources

modified 30-Nov-15 21:45pm.

AnswerRe: Need help with regards to datagridview Pin
OriginalGriff30-Nov-15 21:38
mveOriginalGriff30-Nov-15 21:38 
GeneralRe: Need help with regards to datagridview Pin
Mycroft Holmes30-Nov-15 22:20
professionalMycroft Holmes30-Nov-15 22:20 
GeneralRe: Need help with regards to datagridview Pin
OriginalGriff1-Dec-15 0:05
mveOriginalGriff1-Dec-15 0:05 
GeneralRe: Need help with regards to datagridview Pin
Tbweri1-Dec-15 9:42
Tbweri1-Dec-15 9:42 
AnswerRe: Need help with regards to datagridview Pin
Simon_Whale1-Dec-15 1:17
Simon_Whale1-Dec-15 1:17 
GeneralRe: Need help with regards to datagridview Pin
Eddy Vluggen1-Dec-15 1:19
professionalEddy Vluggen1-Dec-15 1:19 
GeneralRe: Need help with regards to datagridview Pin
Tbweri1-Dec-15 9:54
Tbweri1-Dec-15 9:54 
Questionhow to use thread to control chart? Pin
smallkubi30-Nov-15 15:04
smallkubi30-Nov-15 15:04 
AnswerRe: how to use thread to control chart? Pin
Dave Kreskowiak30-Nov-15 16:05
mveDave Kreskowiak30-Nov-15 16:05 
QuestionUsing static var on a class Pin
Member 1217642830-Nov-15 4:59
Member 1217642830-Nov-15 4:59 
AnswerRe: Using static var on a class Pin
Dave Kreskowiak30-Nov-15 5:08
mveDave Kreskowiak30-Nov-15 5:08 
GeneralRe: Using static var on a class Pin
Member 1217642830-Nov-15 5:42
Member 1217642830-Nov-15 5:42 
AnswerRe: Using static var on a class Pin
Richard Deeming30-Nov-15 5:34
mveRichard Deeming30-Nov-15 5:34 
GeneralRe: Using static var on a class Pin
Member 1217642830-Nov-15 5:41
Member 1217642830-Nov-15 5:41 
AnswerRe: Using static var on a class Pin
OriginalGriff30-Nov-15 6:32
mveOriginalGriff30-Nov-15 6:32 
GeneralRe: Using static var on a class Pin
Richard Deeming30-Nov-15 6:40
mveRichard Deeming30-Nov-15 6:40 
AnswerThanks everyone,someone knows the answer for B. ? Pin
Member 1217642830-Nov-15 6:52
Member 1217642830-Nov-15 6:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.