Failed to generate code. Object reference not set to an instance of an object.
Erro no DataSet.xsd.
I'm having problems changing my dataset.xsd
, I can not add fields or make a new dataset/datasource
.
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="gestservicesbd_oficinaDataSet" targetNamespace="http://tempuri.org/gestservicesbd_oficinaDataSet.xsd" xmlns:mstns="http://tempuri.org/gestservicesbd_oficinaDataSet.xsd" xmlns="http://tempuri.org/gestservicesbd_oficinaDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:annotation>
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="3" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
<Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="gestservicesbd_oficinaConnectionString" IsAppSettingsProperty="true" Modifier="Assembly" Name="gestservicesbd_oficinaConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.GestServices.Properties.Settings.GlobalReference.Default.gestservicesbd_oficinaConnectionString" Provider="MySql.Data.MySqlClient" />
<Connection ConnectionStringObject="server=localhost;user id=root;database=gestservicesbd_oficina;password=820630;persistsecurityinfo=True" IsAppSettingsProperty="false" Modifier="Assembly" Name="localhost(gestservicesbd_oficina)" ParameterPrefix="@" Provider="MySql.Data.MySqlClient" />
</Connections>
<Tables>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="clientesTableAdapter" GeneratorDataComponentClassName="clientesTableAdapter" Name="clientes" UserDataComponentName="clientesTableAdapter">
<MainSource>
<DbSource ConnectionRef="localhost(gestservicesbd_oficina)" DbObjectName="gestservicesbd_oficina.clientes" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
<DeleteCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>DELETE FROM 'clientes' WHERE (('idcliente' = @p1) AND ((@p2 = 1 AND 'nome' IS NULL) OR ('nome' = @p3)) AND ((@p4 = 1 AND 'telefone' IS NULL) OR ('telefone' = @p5)) AND ((@p6 = 1 AND 'codigopostal' IS NULL) OR ('codigopostal' = @p7)) AND ((@p8 = 1 AND 'email' IS NULL) OR ('email' = @p9)) AND ((@p10 = 1 AND 'nif' IS NULL) OR ('nif' = @p11)) AND ((@p12 = 1 AND 'telemovel' IS NULL) OR ('telemovel' = @p13)) AND ((@p14 = 1 AND 'localidade' IS NULL) OR ('localidade' = @p15)))</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p1" Precision="0" ProviderType="Int32" Scale="0" Size="0" SourceColumn="idcliente" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p2" Precision="0" ProviderType="Int32" Scale="0" Size="0" SourceColumn="nome" SourceColumnNullMapping="true" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p3" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="nome" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p4" Precision="0" ProviderType="Int32" Scale="0" Size="0" SourceColumn="telefone" SourceColumnNullMapping="true" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p5" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="telefone" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p6" Precision="0" ProviderType="Int32" Scale="0" Size="0" SourceColumn="codigopostal" SourceColumnNullMapping="true" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p7" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="codigopostal" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p8" Precision="0" ProviderType="Int32" Scale="0" Size="0" SourceColumn="email" SourceColumnNullMapping="true" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p9" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="email" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p10" Precision="0" ProviderType="Int32" Scale="0" Size="0" SourceColumn="nif" SourceColumnNullMapping="true" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p11" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="nif" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p12" Precision="0" ProviderType="Int32" Scale="0" Size="0" SourceColumn="telemovel" SourceColumnNullMapping="true" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p13" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="telemovel" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p14" Precision="0" ProviderType="Int32" Scale="0" Size="0" SourceColumn="localidade" SourceColumnNullMapping="true" SourceVersion="Original" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p15" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="localidade" SourceColumnNullMapping="false" SourceVersion="Original" />
</Parameters>
</DbCommand>
</DeleteCommand>
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>INSERT INTO 'clientes' ('nome', 'telefone', 'morada', 'codigopostal', 'email', 'nif', 'telemovel', 'localidade', 'obs') VALUES (@p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9)</CommandText>
<Parameters>
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p1" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="nome" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p2" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="telefone" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@p3" Precision="0" ProviderType="Text" Scale="0" Size="0" SourceColumn="morada" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p4" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="codigopostal" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p5" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="email" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p6" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="nif" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p7" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="telemovel" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p8" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="localidade" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@p9" Precision="0" ProviderType="Text" Scale="0" Size="0" SourceColumn="obs" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</InsertCommand>
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>SELECT idcliente, nome, telefone, morada, codigopostal, email, nif, telemovel, localidade, obs
FROM clientes
WHERE idcliente >= 0</CommandText>
<Parameters />
</DbCommand>
</SelectCommand>