northfields,
Thank you for your reply. I'm somewhat new to SQL and this is my first attempt at DataSets and TableAdapters. The Query is a TableAdapter query and I've attached its code. I think this is what you mean - if not let me know.
Thanks
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="StudentInfoADataSet" targetNamespace="http://tempuri.org/StudentInfoADataSet.xsd" xmlns:mstns="http://tempuri.org/StudentInfoADataSet.xsd" xmlns="http://tempuri.org/StudentInfoADataSet.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="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
<Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="FINAOsmsSQL1mdf_92291StudentInfoDataSetConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="FINAOsmsSQL1mdf_92291StudentInfoDataSetConnectionString (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.FINAOsmsSQL1mdf_92291StudentInfoDataSetConnectionString.ConnectionString" Provider="System.Data.SqlClient" />
</Connections>
<Tables>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="StudentInfoA_localTableAdapter" GeneratorDataComponentClassName="StudentInfoA_localTableAdapter" Name="StudentInfoA_local" UserDataComponentName="StudentInfoA_localTableAdapter">
<MainSource>
<DbSource ConnectionRef="FINAOsmsSQL1mdf_92291StudentInfoDataSetConnectionString (Web.config)" DbObjectName="[FINAOsmsSQL1.mdf_92291].dbo.StudentInfoA_local" DbObjectType="Table" GenerateMethods="Get" GenerateShortCommands="false" GeneratorGetMethodName="GetStudentInfoAData" GetMethodModifier="Public" GetMethodName="GetStudentInfoAData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetStudentInfoAData" UserSourceName="GetStudentInfoAData">
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>SELECT StudentInfoA_local.*
FROM StudentInfoA_local</CommandText>
<Parameters />
</DbCommand>
</SelectCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="student_id" DataSetColumn="student_id" />
<Mapping SourceColumn="last_name" DataSetColumn="last_name" />
<Mapping SourceColumn="first_name" DataSetColumn="first_name" />
<Mapping SourceColumn="middle_name" DataSetColumn="middle_name" />
<Mapping SourceColumn="Gender" DataSetColumn="Gender" />
<Mapping SourceColumn="birthdate" DataSetColumn="birthdate" />
<Mapping SourceColumn="Grade" DataSetColumn="Grade" />
<Mapping SourceColumn="ethnicity" DataSetColumn="ethnicity" />
<Mapping SourceColumn="lep" DataSetColumn="lep" />
<Mapping SourceColumn="SPED" DataSetColumn="SPED" />
<Mapping SourceColumn="Sheltered" DataSetColumn="Sheltered" />
<Mapping SourceColumn="AIP" DataSetColumn="AIP" />
<Mapping SourceColumn="AVID" DataSetColumn="AVID" />
<Mapping SourceColumn="ELL" DataSetColumn="ELL" />
<Mapping SourceColumn="notes" DataSetColumn="notes" />
<Mapping SourceColumn="StudentARecordNumber" DataSetColumn="StudentARecordNumber" />
<Mapping SourceColumn="He_She" DataSetColumn="He_She" />
<Mapping SourceColumn="His_Hers" DataSetColumn="His_Hers" />
<Mapping SourceColumn="Him_Her" DataSetColumn="Him_Her" />
</Mappings>
<Sources>
<DbSource ConnectionRef="FINAOsmsSQL1mdf_92291StudentInfoDataSetConnectionString (Web.config)" DbObjectName="[FINAOsmsSQL1.mdf_92291].dbo.StudentInfoA_local" DbObjectType="Table" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="GetStudentInfoADataByRecordNumber" GeneratorSourceName="FillBy" GetMethodModifier="Public" GetMethodName="GetStudentInfoADataByRecordNumber" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetStudentInfoADataByRecordNumber" UserSourceName="GetStudentInfoADataByRecordNumber">
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>SELECT student_id, StudentARecordNumber
FROM StudentInfoA_local
WHERE (student_id = @student_id)</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="student_id" ColumnName="student_id" DataSourceName="[FINAOsmsSQL1.mdf_92291].dbo.StudentInfoA_local" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@student_id" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="student_id" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="FINAOsmsSQL1mdf_92291StudentInfoDataSetConnectionString (Web.config)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorGetMethodName="GetDataBy" GeneratorSourceName="InsertStudentInfoAQuery" Modifier="Public" Name="InsertStudentInfoAQuery" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="InsertStudentInfoAQuery">
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>INSERT into [StudentInfoA_local] (student_id, last_name, first_name, middle_name, Gender, birthdate, Grade, ethnicity, lep, SPED, Sheltered, AIP, AVID, ELL, notes, He_She, His_Hers, Him_Her)
VALUES (@student_id, @ last_name, @ first_name, @ middle_name, @ Gender, @ birthdate, @ Grade, @ ethnicity, @ lep, @ SPED, @ Sheltered, @ AIP, @ AVID, @ ELL, @ notes, @ He_She, @ His_Hers, @ Him_Her)
-- return the StudentARecordNumber
SELECT SCOPE_IDENTITY()</CommandText>
<Parameters />
</DbCommand>
</InsertCommand>
</DbSource>
</Sources>
</TableAdapter>
</Tables>
<Sources />
</DataSource>
</xs:appinfo>
</xs:annotation>
<xs:element name="StudentInfoADataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="StudentInfoADataSet" msprop:Generator_DataSetName="StudentInfoADataSet">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="StudentInfoA_local" msprop:Generator_UserTableName="StudentInfoA_local" msprop:Generator_RowDeletedName="StudentInfoA_localRowDeleted" msprop:Generator_RowChangedName="StudentInfoA_localRowChanged" msprop:Generator_RowClassName="StudentInfoA_localRow" msprop:Generator_RowChangingName="StudentInfoA_localRowChanging" msprop:Generator_RowEvArgName="StudentInfoA_localRowChangeEvent" msprop:Generator_RowEvHandlerName="StudentInfoA_localRowChangeEventHandler" msprop:Generator_TableClassName="StudentInfoA_localDataTable" msprop:Generator_TableVarName="tableStudentInfoA_local" msprop:Generator_RowDeletingName="StudentInfoA_localRowDeleting" msprop:Generator_TablePropName="StudentInfoA_local">
<xs:complexType>
<xs:sequence>
<xs:element name="student_id" msprop:Generator_UserColumnName="student_id" msprop:Generator_ColumnPropNameInRow="student_id" msprop:Generator_ColumnVarNameInTable="columnstudent_id" msprop:Generator_ColumnPropNameInTable="student_idColumn" type="xs:int" />
<xs:element name="last_name" msprop:Generator_UserColumnName="last_name" msprop:Generator_ColumnPropNameInRow="last_name" msprop:Generator_ColumnVarNameInTable="columnlast_name" msprop:Generator_ColumnPropNameInTable="last_nameColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="first_name" msprop:Generator_UserColumnName="first_name" msprop:Generator_ColumnPropNameInRow="first_name" msprop:Generator_ColumnVarNameInTable="columnfirst_name" msprop:Generator_ColumnPropNameInTable="first_nameColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="middle_name" msprop:Generator_UserColumnName="middle_name" msprop:Generator_ColumnPropNameInRow="middle_name" msprop:Generator_ColumnVarNameInTable="columnmiddle_name" msprop:Generator_ColumnPropNameInTable="middle_nameColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Gender" msprop:Generator_UserColumnName="Gender" msprop:Generator_ColumnPropNameInRow="Gender" msprop:Generator_ColumnVarNameInTable="columnGender" msprop:Generator_ColumnPropNameInTable="GenderColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="birthdate" msprop:Generator_UserColumnName="birthdate" msprop:Generator_ColumnPropNameInRow="birthdate" msprop:Generator_ColumnVarNameInTable="columnbirthdate" msprop:Generator_ColumnPropNameInTable="birthdateColumn" type="xs:dateTime" minOccurs="0" />
<xs:element name="Grade" msprop:Generator_UserColumnName="Grade" msprop:Generator_ColumnPropNameInRow="Grade" msprop:Generator_ColumnVarNameInTable="columnGrade" msprop:Generator_ColumnPropNameInTable="GradeColumn" type="xs:double" minOccurs="0" />
<xs:element name="ethnicity" msprop:Generator_UserColumnName="ethnicity" msprop:Generator_ColumnPropNameInRow="ethnicity" msprop:Generator_ColumnVarNameInTable="columnethnicity" msprop:Generator_ColumnPropNameInTable="ethnicityColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="lep" msprop:Generator_UserColumnName="lep" msprop:Generator_ColumnPropNameInRow="lep" msprop:Generator_ColumnVarNameInTable="columnlep" msprop:Generator_ColumnPropNameInTable="lepColumn" type="xs:boolean" minOccurs="0" />
<xs:element name="SPED" msprop:Generator_UserColumnName="SPED" msprop:Generator_ColumnPropNameInRow="SPED" msprop:Generator_ColumnVarNameInTable="columnSPED" msprop:Generator_ColumnPropNameInTable="SPEDColumn" type="xs:boolean" minOccurs="0" />
<xs:element name="Sheltered" msprop:Generator_UserColumnName="Sheltered" msprop:Generator_ColumnPropNameInRow="Sheltered" msprop:Generator_ColumnVarNameInTable="columnSheltered" msprop:Generator_ColumnPropNameInTable="ShelteredColumn" type="xs:boolean" minOccurs="0" />
<xs:element name="AIP" msprop:Generator_UserColumnName="AIP" msprop:Generator_ColumnPropNameInRow="AIP" msprop:Generator_ColumnVarNameInTable="columnAIP" msprop:Generator_ColumnPropNameInTable="AIPColumn" type="xs:boolean" minOccurs="0" />
<xs:element name="AVID" msprop:Generator_UserColumnName="AVID" msprop:Generator_ColumnPropNameInRow="AVID" msprop:Generator_ColumnVarNameInTable="columnAVID" msprop:Generator_ColumnPropNameInTable="AVIDColumn" type="xs:boolean" minOccurs="0" />
<xs:element name="ELL" msprop:Generator_UserColumnName="ELL" msprop:Generator_ColumnPropNameInRow="ELL" msprop:Generator_ColumnVarNameInTable="columnELL" msprop:Generator_ColumnPropNameInTable="ELLColumn" type="xs:boolean" minOccurs="0" />
<xs:element name="notes" msprop:Generator_UserColumnName="notes" msprop:Generator_ColumnPropNameInRow="notes" msprop:Generator_ColumnVarNameInTable="columnnotes" msprop:Generator_ColumnPropNameInTable="notesColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2147483647" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="StudentARecordNumber" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_UserColumnName="StudentARecordNumber" msprop:Generator_ColumnPropNameInRow="StudentARecordNumber" msprop:Generator_ColumnVarNameInTable="columnStudentARecordNumber" msprop:Generator_ColumnPropNameInTable="StudentARecordNumberColumn" type="xs:int" />
<xs:element name="He_She" msprop:Generator_UserColumnName="He_She" msprop:Generator_ColumnPropNameInRow="He_She" msprop:Generator_ColumnVarNameInTable="columnHe_She" msprop:Generator_ColumnPropNameInTable="He_SheColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="His_Hers" msprop:Generator_UserColumnName="His_Hers" msprop:Generator_ColumnPropNameInRow="His_Hers" msprop:Generator_ColumnVarNameInTable="columnHis_Hers" msprop:Generator_ColumnPropNameInTable="His_HersColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Him_Her" msprop:Generator_UserColumnName="Him_Her" msprop:Generator_ColumnPropNameInRow="Him_Her" msprop:Generator_ColumnVarNameInTable="columnHim_Her" msprop:Generator_ColumnPropNameInTable="Him_HerColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:StudentInfoA_local" />
<xs:field xpath="mstns:student_id" />
</xs:unique>
</xs:element>
</xs:schema>
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164:





by: northfieldsPosted on 2009-10-20 at 22:07:28ID: 25620928
Hi
how was it defined, it looks like it is throwing the error because InsertStudentInfoAQuery() doesnt take any arguments, even though you specify them in the snippet.
Can you post details about InsertStudentInfoAQuery(),