NOVO ERRO NA PROGRAMAÇÂO SQL
Joel Rodrigues, DA ESSA FORÇA NOVAMENTE AI
O ERRO TA NA LINHA 207 E 245 NA PALAVRA NEW
public DataTable ListaGrid()
{
vsql = "SELECT [NOME], [CPF], [RG], [DATANASC], [CEL], [TEL], [ENDERECO], [BAIRRO ], [CIDADE], [ESTADO], [EMAIL], [SITE], [BANCO], [Nº], [AGENCIA], [REGIONAL], [INSTITUICAO], [MESTREGRIO], [GRIOAPRENDIZ] CAD_CLIENTE";
return null;
SqlCommand objcmd = null;
if (this.conectar())
{
return null;
try
{
objcmd = new SqlCommand(vsql, objCon);
SqlDataAdapter adp = new SqlDataAdapter(objcmd);
DataTable dt new DataTable();
adp.Fill(dt);
return dt;
}
catch (SqlException Sqlerr)
{
throw Sqlerr;
}
finally
{
this.desconctar();
}
}
}
public DataTable Pesquisar(string sql)
{
this.vsql = sql;
return null;
SqlCommand objcmd = null;
if (this.conectar())
{
return null;
try
{
objcmd = new SqlCommand(vsql, objCon);
SqlDataAdapter adp = new SqlDataAdapter(objcmd);
DataTable dt new DataTable();
adp.Fill(dt);
return dt;
}
catch (SqlException Sqlerr)
{
throw Sqlerr;
}
finally
{
this.desconctar();
}
}
}
}
}
O ERRO TA NA LINHA 207 E 245 NA PALAVRA NEW
public DataTable ListaGrid()
{
vsql = "SELECT [NOME], [CPF], [RG], [DATANASC], [CEL], [TEL], [ENDERECO], [BAIRRO ], [CIDADE], [ESTADO], [EMAIL], [SITE], [BANCO], [Nº], [AGENCIA], [REGIONAL], [INSTITUICAO], [MESTREGRIO], [GRIOAPRENDIZ] CAD_CLIENTE";
return null;
SqlCommand objcmd = null;
if (this.conectar())
{
return null;
try
{
objcmd = new SqlCommand(vsql, objCon);
SqlDataAdapter adp = new SqlDataAdapter(objcmd);
DataTable dt new DataTable();
adp.Fill(dt);
return dt;
}
catch (SqlException Sqlerr)
{
throw Sqlerr;
}
finally
{
this.desconctar();
}
}
}
public DataTable Pesquisar(string sql)
{
this.vsql = sql;
return null;
SqlCommand objcmd = null;
if (this.conectar())
{
return null;
try
{
objcmd = new SqlCommand(vsql, objCon);
SqlDataAdapter adp = new SqlDataAdapter(objcmd);
DataTable dt new DataTable();
adp.Fill(dt);
return dt;
}
catch (SqlException Sqlerr)
{
throw Sqlerr;
}
finally
{
this.desconctar();
}
}
}
}
}
Márcio Silva
Curtidas 0
Respostas
Raniel Gomes
15/06/2013
Amigo especifica melhor o erro pois não dá para visualizar as linhas, qual a mensagem que retornou no CATCH?
Na verdade você está tentando fazer oque? povoar um DataGridView?
Na verdade você está tentando fazer oque? povoar um DataGridView?
GOSTEI 0
William
15/06/2013
Srs. entendo que essa dúvida seja coerente com o fórum .net, estou alterando o fórum.
GOSTEI 0
Joel Rodrigues
15/06/2013
A tabela se chama CAD_CLIENTE?
Faltou o FROM na instrução SQL:
Faltou o FROM na instrução SQL:
vsql = "SELECT [NOME], [CPF], [RG], [DATANASC], [CEL], [TEL], [ENDERECO], [BAIRRO ], [CIDADE], [ESTADO], [EMAIL], [SITE], [BANCO], [Nº], [AGENCIA], [REGIONAL], [INSTITUICAO], [MESTREGRIO], [GRIOAPRENDIZ] CAD_CLIENTE";
GOSTEI 0
Hector Figueroa
15/06/2013
Coloque o FROM para ele saber de qual tabela retornar as colunas, como esta no código abaixo:
vsql = "SELECT [NOME], [CPF], [RG], [DATANASC], [CEL], [TEL], [ENDERECO], [BAIRRO ], [CIDADE], [ESTADO], [EMAIL], [SITE], [BANCO], [Nº], [AGENCIA], [REGIONAL], [INSTITUICAO], [MESTREGRIO], [GRIOAPRENDIZ] FROM CAD_CLIENTE";
GOSTEI 0
Joel Rodrigues
15/06/2013
E aí,véi? Problema resolvido?
GOSTEI 0
Fernanda Acacia
15/06/2013
esse é muito comum, esquecer alguma coisa do sql.
GOSTEI 0
Joel Rodrigues
15/06/2013
Pelo jeito a dúvida foi sanada.
Como não houve retorno, estou concluindo o tópico.
Como não houve retorno, estou concluindo o tópico.
GOSTEI 0