Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am having a problem

I have a connections which i accessing data from a database. after connecting a database i am filling a dataset with a table and showing results in a Grid. i grid i change many values

but these values are not commited to database

 

is there any way so i could be able to commit that dataset back to there from where it was originated

The one and only

Dr. Madz

eee-m@il

Posted

I am working on a project with which an administrator can enter informaton about his dealers and distributors. this is code of customers table

 

this is the Dataset which i am using

<?xml version="1.0" standalone="yes" ?>
<xs:schema id="dtCustomers" targetNamespace="http://www.tempuri.org/dtCustomers.xsd" xmlns:mstns="http://www.tempuri.org/dtCustomers.xsd" xmlns="http://www.tempuri.org/dtCustomers.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="dtCustomers" msdata:IsDataSet="true">
	<xs:complexType>
		<xs:choice maxOccurs="unbounded">
			<xs:element name="Customers">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="Name" type="xs:string" />
						<xs:element name="Distributor" type="xs:boolean" />
						<xs:element name="Dealer" type="xs:boolean" />
						<xs:element name="Address" type="xs:string" />
						<xs:element name="City" type="xs:string" />
						<xs:element name="Phone" type="xs:string" />
						<xs:element name="Fax" type="xs:string" minOccurs="0" />
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:choice>
	</xs:complexType>
</xs:element>
</xs:schema>

 

next with a search button i am doing this filling the Dataset and Refreshing the Results in a Grid

 

dsShowCustomers.Clear()
       On Error Resume Next
       If Not cboCity.Text = "" Then ' cbocity is a Combo Box in which some cities are listed.
           cmdSelectCustomer.CommandText = "Select Name, Distributor, Dealer, Address, City, Phone, Fax From Customers Where City = '" & cboCity.Text & "'"
           Debug.WriteLine(cmdSelectCustomer.CommandText)
       Else
           cmdSelectCustomer.CommandText = "Select Name, Distributor, Dealer, Address, City, Phone, Fax From Customers"
       End If
       mySQL.Open()
       cmdSelectCustomer.ExecuteNonQuery()
       mySQL.Close()
       myAdapter.Fill(dsShowCustomers)
      'datagrid here        
       dgCustomers.Refresh()

 

Here i am able to generate the Dataset i am making changes in Data in DataGrid but i dont know how to send it back to Database

here myAdapter.update(dataset) doesnot working.

Is there any solution

The one and only

Dr. Madz

eee-m@il

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...