getting problem while updation

Posted by Jammyhunt under ASP.NET on 7/14/2013 | Points: 10 | Views : 1206 | Status : [Member] | Replies : 2
hey guys..

i have created a gridview using ms access database

source below




<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/App_Data/daksh.mdb"
DeleteCommand="DELETE FROM [bills] WHERE (([bill no] = ?) OR ([bill no] IS NULL AND ? IS NULL))"
InsertCommand="INSERT INTO [bills] ([bill no], [bill date], [bank], [district], [branch], [total amt], [comission], [account type], [bill date range], [remarks]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
SelectCommand="SELECT [bill no] AS bill_no, [bill date] AS bill_date, [bank], [district], [branch], [total amt] AS total_amt, [comission], [account type] AS account_type, [bill date range] AS bill_date_range, [remarks] FROM [bills]"
UpdateCommand="UPDATE [bills] SET [bill date] = ?, [bank] = ?, [district] = ?, [branch] = ?, [total amt] = ?, [comission] = ?, [account type] = ?, [bill date range] = ?, [remarks] = ? WHERE (([bill no] = ?) OR ([bill no] IS NULL AND ? IS NULL))">
<DeleteParameters>
<asp:Parameter Name="bill_no" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="bill_no" Type="Int32" />
<asp:Parameter Name="bill_date" Type="String" />
<asp:Parameter Name="bank" Type="String" />
<asp:Parameter Name="district" Type="String" />
<asp:Parameter Name="branch" Type="String" />
<asp:Parameter Name="total_amt" Type="String" />
<asp:Parameter Name="comission" Type="String" />
<asp:Parameter Name="account_type" Type="String" />
<asp:Parameter Name="bill_date_range" Type="String" />
<asp:Parameter Name="remarks" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="bill_date" Type="String" />
<asp:Parameter Name="bank" Type="String" />
<asp:Parameter Name="district" Type="String" />
<asp:Parameter Name="branch" Type="String" />
<asp:Parameter Name="total_amt" Type="String" />
<asp:Parameter Name="comission" Type="String" />
<asp:Parameter Name="account_type" Type="String" />
<asp:Parameter Name="bill_date_range" Type="String" />
<asp:Parameter Name="remarks" Type="String" />
<asp:Parameter Name="bill_no" Type="Int32" />
</UpdateParameters>
</asp:AccessDataSource>



whenever i am using update option its giving me this error.

Exception Details: System.Data.OleDb.OleDbException: No value given for one or more required parameters.


Remarks: i have the same colums in both database and gridview




Responses

Posted by: lakhansin-22735 on: 7/14/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

Is there any field which is NOT NULLABLE, but not passing by us?


Thanks

Lakhan Singh
Tech Lead
BeyondKey System Pvt. Ltd.
Indore, M.P.
India

Jammyhunt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jammyhunt on: 7/14/2013 [Member] Starter | Points: 25

Up
0
Down
nope

Jammyhunt, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response