Click here to Skip to main content
15,920,602 members
Home / Discussions / C#
   

C#

 
AnswerRe: Way the open Windows freeze when I go back to open Windows Pin
Brisingr Aerowing5-Jan-16 7:07
professionalBrisingr Aerowing5-Jan-16 7:07 
GeneralRe: Way the open Windows freeze when I go back to open Windows Pin
Mycroft Holmes5-Jan-16 13:14
professionalMycroft Holmes5-Jan-16 13:14 
GeneralRe: Way the open Windows freeze when I go back to open Windows Pin
Brisingr Aerowing5-Jan-16 14:19
professionalBrisingr Aerowing5-Jan-16 14:19 
QuestionShockwave Simply Stopped (Maybe Windows 10 update issue) Pin
PDTUM4-Jan-16 14:05
PDTUM4-Jan-16 14:05 
AnswerRe: Shockwave Simply Stopped (Maybe Windows 10 update issue) Pin
Dave Kreskowiak4-Jan-16 18:08
mveDave Kreskowiak4-Jan-16 18:08 
GeneralRe: Shockwave Simply Stopped (Maybe Windows 10 update issue) Pin
PDTUM5-Jan-16 8:30
PDTUM5-Jan-16 8:30 
GeneralRe: Shockwave Simply Stopped (Maybe Windows 10 update issue) Pin
Dave Kreskowiak5-Jan-16 9:26
mveDave Kreskowiak5-Jan-16 9:26 
QuestionCombobox to filter a datagrid c# Pin
Member 114494474-Jan-16 3:20
Member 114494474-Jan-16 3:20 
I have a trouble with my code in trying to add a combobox to filter a datagrid. It complains in the dataview constructor ("The best overloaded method match for'System.Data.DataView.DataView(System.Data.DataTable')has some invalid arguments".

It also complains in the declaration of rowgrid object: 'System.Data.DataSet' does not contain a definition for 'DefaultView' and no extension method 'DefaultView' accepting a first argumentof type 'System.Data.DataSet' could be found (are you missing a using directive or an assembly reference?)

C#
public void Consulta()
       {
           //MessageBox.Show(grid_lic.CurrentRow.Cells[3].Value.ToString());
           con = new OdbcConnection("driver= {MySQL ODBC 5.1 Driver};server=xxxx; database=licenciamento; uid=estagio; password=1234; option = 3 ");
           con.Open();

           OdbcCommand Command = con.CreateCommand();
           Command.CommandText = "select lojas.Id, lojas.NIF, lojas.Loja, lojas.Bloquear, lojas.DataFim, lojas.lastupdate, lojas.Nome, " +
           " licenciamentoloja.EArtigo, licenciamentoloja.EFamilia, licenciamentoloja.EClientes, licenciamentoloja.EFornecedores, licenciamentoloja.Evendas," +
           "licenciamentoloja.ECompras, licenciamentoloja.EStocks, licenciamentoloja.ELiquidacao, licenciamentoloja.ECaixas, licenciamentoloja.EInfoStock," +
           "licenciamentoloja.ZSArtigos, licenciamentoloja.ZSClientes, licenciamentoloja.ZSStocks, licenciamentoloja.id from lojas inner join licenciamentoloja on lojas.NIF = licenciamentoloja.NIF and lojas.Loja = licenciamentoloja.loja";

           Command.CommandType = CommandType.Text;
           Command.Connection = con;

           OdbcDataAdapter adapter = new OdbcDataAdapter();
           adapter.SelectCommand = Command;

           DataSet ds = new DataSet();
           adapter.Fill(ds);
           grid_lic.DataSource = ds;
           grid_lic.DataMember = ds.Tables[0].TableName;

           DataView dv = new DataView(ds);
           comboBox_NIF.DataSource = dv;
           comboBox_NIF.ValueMember = "NIF";
           comboBox_NIF.DisplayMember = "loja";
           //grid_lic.DataSource = ds.DefaultView;
           comboBox_NIF.SelectedIndexChanged += comboBox_NIF_Change;
           ds.DefaultView.RowFilter = "ProductID = " + Convert.ToString(comboBox_NIF.SelectedValue);

AnswerRe: Combobox to filter a datagrid c# Pin
Sascha Lefèvre4-Jan-16 3:38
professionalSascha Lefèvre4-Jan-16 3:38 
GeneralRe: Combobox to filter a datagrid c# Pin
Member 114494474-Jan-16 3:44
Member 114494474-Jan-16 3:44 
GeneralRe: Combobox to filter a datagrid c# Pin
Sascha Lefèvre4-Jan-16 4:08
professionalSascha Lefèvre4-Jan-16 4:08 
GeneralRe: Combobox to filter a datagrid c# Pin
Member 114494475-Jan-16 4:25
Member 114494475-Jan-16 4:25 
GeneralRe: Combobox to filter a datagrid c# Pin
Sascha Lefèvre5-Jan-16 5:15
professionalSascha Lefèvre5-Jan-16 5:15 
GeneralRe: Combobox to filter a datagrid c# Pin
Member 114494475-Jan-16 5:23
Member 114494475-Jan-16 5:23 
GeneralRe: Combobox to filter a datagrid c# Pin
Sascha Lefèvre5-Jan-16 6:04
professionalSascha Lefèvre5-Jan-16 6:04 
GeneralRe: Combobox to filter a datagrid c# Pin
Member 114494475-Jan-16 6:26
Member 114494475-Jan-16 6:26 
AnswerRe: Combobox to filter a datagrid c# Pin
Sascha Lefèvre5-Jan-16 7:00
professionalSascha Lefèvre5-Jan-16 7:00 
GeneralRe: Combobox to filter a datagrid c# Pin
Member 114494475-Jan-16 22:45
Member 114494475-Jan-16 22:45 
GeneralRe: Combobox to filter a datagrid c# Pin
Member 114494475-Jan-16 22:59
Member 114494475-Jan-16 22:59 
GeneralRe: Combobox to filter a datagrid c# Pin
Sascha Lefèvre6-Jan-16 0:26
professionalSascha Lefèvre6-Jan-16 0:26 
QuestionHow to merge same cells value into single cell in C# Pin
Ashfaque Hussain4-Jan-16 2:50
Ashfaque Hussain4-Jan-16 2:50 
SuggestionRe: How to merge same cells value into single cell in C# Pin
Sascha Lefèvre4-Jan-16 3:16
professionalSascha Lefèvre4-Jan-16 3:16 
GeneralRe: How to merge same cells value into single cell in C# Pin
Ashfaque Hussain4-Jan-16 18:51
Ashfaque Hussain4-Jan-16 18:51 
GeneralRe: How to merge same cells value into single cell in C# Pin
Richard Deeming5-Jan-16 2:22
mveRichard Deeming5-Jan-16 2:22 
SuggestionRe: How to merge same cells value into single cell in C# Pin
Richard Deeming4-Jan-16 3:17
mveRichard Deeming4-Jan-16 3:17 

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.