
laredo512
Avatar/Signature-
Posts
89 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by laredo512
-
Hi, I need to be able to get a user to select a record from a separate window that contains a dataset. What would be a quick and appropriate way to make it work like an inputbox ? for example: Private Sub GetInfo() ... perform tasks ... if criteria1 = get external data then frmQuery.Showdialog() ... once the info is selected from the frmQuery, pass it back to this part of the sub routine end sub frmQuery has a datagrid.. Thanks for any help given.
-
Update command not working with NULL DateTime Valies
laredo512 replied to pendragon's topic in Database / XML / Reporting
try: Update tblPrimary SET(fldOne, fldTwo .... ) Values( <<< use parameters >>>) WHERE fldDateYouAreLookingFfor IS NULL also try this for your SOPDueDate --> convert.todatetime("31/08/2004") -
Update command not working with NULL DateTime Valies
laredo512 replied to pendragon's topic in Database / XML / Reporting
Check this thread : http://www.xtremedotnettalk.com/showthread.php?t=86088 -
unhandled exception: System.InvalidOperationException
laredo512 replied to MikeyLDS's topic in Database / XML / Reporting
Lookup the user Joe Mamma and the word parameters in this forum. :) -
unhandled exception: System.InvalidOperationException
laredo512 replied to MikeyLDS's topic in Database / XML / Reporting
BTW, Mikey started this thread. I beleive the topic is his. -
unhandled exception: System.InvalidOperationException
laredo512 replied to MikeyLDS's topic in Database / XML / Reporting
Do you have relations in the database? If you do, chances are this is the cause of it too. You should consider looking into typing up your queries and updates -
unhandled exception: System.InvalidOperationException
laredo512 replied to MikeyLDS's topic in Database / XML / Reporting
Assuming you are using the system's wizard, you have to make sure your primary keys ARE assigned in your database. Otherwise, the system will give you those warning. Then, if the all statements ARE generated without warnings, you can use them. Otherwise, you have to type them out manually using parameters. -
unhandled exception: System.InvalidOperationException
laredo512 replied to MikeyLDS's topic in Database / XML / Reporting
In design time, when you get such a message, its because the system did NOT generate any update or insert command because you do NOT have a primary key in your db -
Decimals getting rounded off for no reason
laredo512 replied to laredo512's topic in Database / XML / Reporting
doh! Ya I thought of that.... NOT Thanks a bunch Nerseus, I had overlooked that "precise" detail. -
Hi All, Got this issue with SQL decimals. I have 3 variables: decWeight as decimal decCBM as decimal decBox as decimal Until they get inserted into the db, the IDE watch reports them as still being decimals (ex: decWeight 's value = 1200.31D as type decimal). Why does SQL Server round off these values to make them integers ? (The db fields are set to decimals) Thanks for any help you can provide.
-
Im in around Montreal QC... 4:38 PM
-
Whats the actual recommended time in front of a code windows before one can be declared officially insane and unfit for public outings? <<< been at this too long... KIT KAT!!! where is it !!!! I found the prob... the nothing somehow slipped into one of the variables in my code. Using the IDE generated parameters saved me a ton of code.... Thanks for your help Joe, much appreciated
-
at the break point, the field is set as AllowDBNull = true However, I did notice that if no date is present, the system, for some stupid reason is not making my object System.DBNull.Value ... its set to Nothing.... <<<--- that has to be be problem... checking....
-
For the past 2 hours, I have been experimenting in that direction... :mad: all the date fields in my dataset are set to nillable = true and I still get the darn date overflow error OR the prepared statement. (.... the IDE insert statement ... .) expects the @strArrDate to be specified which was not. <<-- that happens because there is no date selected for strArrDate. strArrDate is now dim as object in case it is null. Mind you, I triple checked to make sure I included all 24 parameters. I have a feeling these IDE datasets dont like nulls. [code] Dim x as Object = System.DBNull.Value With Me.daInserCont .Connection.Open() .Parameters(0).Value = strMainID .Parameters(1).Value = strContainer .Parameters(2).Value = x .Parameters(3).Value = x .Parameters(4).Value = x .Parameters(5).Value = strContPickUp .Parameters(6).Value = strContDate .Parameters(7).Value = x .Parameters(8).Value = strContPUWaybill .Parameters(9).Value = x .Parameters(10).Value = x .Parameters(11).Value = x .Parameters(12).Value = x .Parameters(13).Value = strArrDate .Parameters(14).Value = strStorDate .Parameters(15).Value = decWeight .Parameters(16).Value = decCBM .Parameters(17).Value = decBoxes .Parameters(18).Value = x .Parameters(19).Value = x .Parameters(20).Value = x .Parameters(21).Value = strComments .Parameters(22).Value = gUserID .Parameters(23).Value = strDateNow .ExecuteNonQuery() .Connection.Close() End With [/code] I guess its time to start typing now before darkness falls on this program...
-
Joe, In the case where someone would want to use the IDE generated datasets with their automatically generated adapters (which themselves contain parameters), how would one make a Date field accept a DBNull value. Contrary to a typed, parameterized insert statement where this would work, the dataset does not permit a DBNull Value in its structure. any thoughts? thanks
-
ya, i read another post dealing with you explaining nulls, already intergrated in the code before this started. Thanks
-
I do have northwind. By the way, your solution of convert.todatetime(strArrDate) solved my problem. Thanks
-
So, what you are saying basically, for any of this date mayhem to end, in any app development, one should stick to OleDB ?
-
User input .... a date time picker.... My system locale is English(Canada)... By default, the format of the date is dd/MM/yyyy h:mm:ss tt
-
I had to change your suggestion to strQ.Parameters.add(new SqlParameter("strArrDate", strArrdate) etc ... now I get : The conversion of char type data to a datetime data type resulted in an out of range datetime value. ?!?
-
Joe, I must admit, I am at an impass at the moment. I have read the examples you pointed out, but still seem to fail in creating a parameterized query. I use vb.net to code my application. I fail to comprehend the @ symbol in the query. I know they refer to the parameters, but I cant see the relation between those @field in a parameterized query and those inside the IDE generated update statements for each sqlDataAdapter I created. In other instances, the ? is used inside the query string and then the command.parameters(integer).value = me.datePicker.value I have attempted the latter (with the ? ) Forgot to mention: strArrdate and strStorDate are Dim as Date [code] strQ.Connection = Me.cn strQ.Connection.Open() strQ.CommandText = "insert into tblcontainer(fldarrivaldate, fldstoragedate, fldtotalweight) VALUES(?, ?, ?) strQ.Parameters(0).Value = strArrDate strQ.Parameters(1).Value = strStorDate strQ.Parameters(2).Value = decWeight strQ.ExecuteNonQuery() strQ.Connection.Close() Exit Select [/code] and I get Invalid index 0 for the SQLParameterCollection with count 0 What am I doing wrong? Thanks
-
Thanks, thats a much better answer. Besides, I am not building a web app... Thanks again.
-
Since you seem keen on giving it to us "inexperienced" users on how dynamic sql is bad, why dont you post something constructive instead so that we can learn from and improve... at least to keep us at bay with "bad" questions. Lets be assertive. Thanks
-
A continuation if you please... I have an English(canada) locale on my machine. Running MSDE2000A (of course, the locale is English(US) on this) How do I go about entering the right dates in the addTableRow events of the datasets so that I can use the simple dataAdapter.Update command? Or am I to type the whole insert statement manually as above? Thanks
-
Ouin... I already configured the webconfig file so that it only uses login.aspx as the login page. It's also set to use formsAuthentication. Here's the code of the webconfig file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <compilation defaultLanguage="vb" debug="true" /> <customErrors mode="RemoteOnly" defaultRedirect="error.html" /> <authentication mode="Forms"> <forms loginUrl="login.aspx" name = "SiteLog" timeout="90"/> </authentication> <authorization> <deny users="?" /> <!-- Allow all users --> </authorization> <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" /> <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" /> <globalization requestEncoding="utf-8" responseEncoding="utf-8" /> </system.web> <location path="members"> <system.web> <authorization> <deny users="?" /> </authorization> </system.web> </location> </configuration>