Jump to content
Xtreme .Net Talk

hemenkap

Avatar/Signature
  • Posts

    29
  • Joined

  • Last visited

1 Follower

About hemenkap

  • Birthday 01/31/1980

Personal Information

  • Occupation
    VB.NET Programmmer
  • .NET Preferred Language
    VB.NET

hemenkap's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. hi dyanmic_sysop, thanks a lot for the much needed help. Hemen Kapadia
  2. hi friends, finally after about 2 months this problem is solved. you can do the following as i do it. the commandtext of my select command looks like this. SELECT * FROM TABLE ORDER BY COLUMN_YOU_WANT_TO_SEARCH_ON the column on which i order is the customer code ( for example) which i have ket unique and is indexed as i dont want to repeat codes the primary key is and integer column hidden from the user of the system. now once you have filled a table in the dataset you have to create a dataview from this table using the ORDER BY column to sort it. The dataview.Find method returns an index ( long ) of the position of the current datarow in the sorted dataset rather than the actual datarow as returned by most other find methods. this is the only way i could do it. if anybody knows any better way do let me know. i dont remember the actual dataview code. it is very small about 3 to 4 lines you can see it in MSDN Hemen Kapadia
  3. Hi, Thanks for you advice. i tried it out today and it worked. Hemen Kapadia
  4. hi, i am using the dataadapters update method to update the data written in the tables stored in the dataset. also i am using transactions to do so. one important thing is that the code works fine in Windows XP and Windows server 2000 with both access and MS sql server 2000 however when i tried it in win 98 using MSDE it works fine but the same code gives this concurrency erro with access in 98. god knows why? i tried to figure it out but in wain.please help....
  5. I wanted to write some form level settings in an ini file. i was abel to write them using the writeprivateprofilestring API call but i am unable to use the GetPrivateProfileString to Retrive the written values back. can you help me how to do that? Hemen Kapadia
  6. hi robby, no i hacve taken care of this too. i have made sure that whenever i open a connection i do close it. my problem is that it inserts rows fine but when you update an existing row it gives error. i will try to create a sample project and paste the code in the meantime if you have any ideas as to wh this is happenning do reply. Hemen Kapadia
  7. hi friends, would like your comments on this one txtLocation.Text = Trim(Cstr(IIF(IsDBNull(RcrdSt("Location"))," ",RcrdSt("Location")))) please match the brackets as i am finding it difficult to do so without the .NET ide. bye
  8. i want to emulate the recordset.find method for the dataset. my main concern is that recordset.find method returns the position ( or rather it moves to cursor to the record that fulfills the criteria) and the we can get the position using the absloute position property. i want to do the same thing for dataset. i dont want the function to return the matching datarow, i want it to return the position of the matching datarow in the dataset. Thanks
  9. hi, i have created an application in VB.NET using Access XP as the backend ( actually i use it with SQLserver also ) all i do is change the connection string of the oledbconnection. now i have teste my application on XP as well as Windows 2000 but when i try to use it on 98 it works fine by retriving the data. when i try to insert a record it inserts it also. however when i try to update a record it gives me a concurrency error even when i am the only person using the application and even when access database is closed. help please.
  10. hi markitzero the error "Cast from type 'DBNull' to type 'String' is not valid" is raised by Cstr and even in the iif ststement that u have youes you have still made the same mistake. it will still give the same error as you are still trying to convert a null value to string. you can try as nersus said or if you still want to stick to iff then do it this way txtLocation.Text = IIF(IsDBNull(RcrdSt("Location"),"",RcrdSt("Location").ToString())
  11. hi , just as jfackler said you nedd to use a dataadapter and a dataset for this. say you fill the dataset using the dataadapter and call you table as Table1 then you can get the recordcount as Dataset.Tables("Table1").Rows.Count bye.
  12. hi, i think you are not calling Dataset.Update to reflect the in memory changes back to the database. might be that is the reason your database is not geting updated. try checking if the changes you make in the memory are actually happenning using breakpoint in the code. if they are then you need to reflect then back to the database using Dataset.Update
  13. thanks, but dr.Item("IDRow") will return the data stored in the colum called idRow in the database. it dont want that . it want the position of the datarow in the dataset. what i need is this, i am explaining it in terms of recordset. as it might make things clear. when we do recordset.Find ( SOME CRITERIA ) the the recordset is searched for all rows and it stops at the row which satisfies our condition. moves to current row pointer to that row. now since in a dataset there is nothing like the current row pointer ( this is the reason we do not have anything like Move last, move first etc...) . i treied a lot will try this too. if it works i will let you know bye, hemen Kapadia
  14. look yaniv, what you gain in this new way will occur to you as you prac tice furthur. just want to explain to you where you were going wrong. look the dataAdapter has 4 commands associated with it. one for each of the following actions. Select, Update, Insert & Delete. each of this is a seperate property of the dataadapter. you were setting the query for the select command only. so how will the data adapter know what is the delete.update/insert query unless and untill you set that query using updatecmd.commandtext = " SQL update stmt" dataadapter.updatecommand = updatecmd so now the dataadapter know how to update it. to save you the hassel of writing the update/insert/delete commands we have something called command builder which is excplained by sizer what it does is that i creates the sql query for each of the 3 actions. NOTE : you have to first give the select command and sql select stmt for the command builder to work else it wont work. Hemen
  15. you can even youe something like this st = conn.CreateCommand st.CommandText = "Sql Select Statement" Ada.SelectCommand = st ada.fill( ds , "Table Name") ' if you want to update /insert/delete in the same table then add Dim cb as oledb.Commandbuilder = new _ oledb.Commandbuilderada) however check the commandbuilder sysntax. i mya hav made some error. not sure..
×
×
  • Create New...