15 comments found.
I have an Error “The type initializer for ‘DAL.SqlHelper’ threw an exception.”
Sorry it is suppose to be very straight forward and easy to use but somehow I cant get the result for the query, is the “result” thing like a resultset where it can be displayed on grid control for example? or is it a type of integer or decimal to display or assign to a variable? May I kindly request for a very simple project where you used the sql helper ? Thanks!
I don’t have sample project right now I made this almost like 6 years ago. I have created new version but writing document from long time but will release soon.
How do I traverse or loop into the Myresult if it returns 2 or more resultset? Do you have an example? Thanks!
You can simple access with result.dsetData.Tables\[0] & result.dsetData.Tables\[1]
Thanks. May I kindly request for an example ?
I am not working on that technology any more but I can help you if you have any code and if you need help. Please read my above comment.
Dim result4 As MyResult = dTable.Select(“pos”, Item,Qty,Price,0)”, “sInsert_id =’” & PDSAAppConfig.CurrentLoginID & ”’ AND STATUS=0 And mowd =’CHEQUE’”)
if it brings out 1 or more result how will I loop using the code below Dim var1 As String = CType(result4.dsetData.Tables(0).Rows(0)(0), String) Dim var2 As Decimal = CType(result4.dsetData.Tables(0).Rows(0)(0), Decimal)
I think I should have a count first to determine the loop right? How do I get the count of the MyResult ? and substitute the Rows() paramenter ? And How do Iget the value of each columns? Thnaks!
Is it possible to loop into the sql result or query and do some updating based on that result and possibly update other tables using sql helper?
Can this be used in desktop app vb.net? Thanks very much
Hi @RapidoRoman,
You can update records through DataSet of .Net object.
Also it will work with vb.net but document is for only c#.net
Thanks for the reply, May I kindly request if yo can make also a demo on how to do it?
Yes. It would be great. So I can add new features.
How do I display the fetched data to a DataGridView?
You can fetch data into MyResult with dataset/datatable and you can bind that one.
Hi, I purchased and having a little challenge in getting this query working
Cities table – has Id, list of cities Comments table – has userI, Comments, dates, citiesForeignKey)
So, I want to get user comments in a city,
(GroupBy Cities, Between Jan and May, for userId James)
thanks
@smartgrid, Apologize for delay reply was on Vacation.
Right now you can’t do group by query here. I am going to release new version soon. Just Writing document for that one.
Very nice job dude
Thank you.
Good job, wish you big sales
Thank you.
can insert and update database ? or i can customize easy or not ,i want to buy now
You can execute any query very easily. And you can get entire source code so you can customize however you like.
please update or create new products for support I will buy it ,thank
Sure. I have already created new version but need to write document. I will write soon and will update here.
thank you
Hi I am trying to use this code MyResult result = SqlHelper.GetTables(“customers”); It is throwing error The type initializer for ‘DAL.SqlHelper’ threw an exception Am i missing something ? pls guide
Can I have rest of code for that page?
So I can get more idea about your code and what is error?
Also can I have detail error message?
I have send you an email, pls check
pls reply
Hi,
What’s your dot net version? it should be 3.5+
Did you check your connection string?
It should be on web.config file.
Still if you have problem then Can I have your code?
Hi, I have sent you an email of the project. Its in dotnet 4.0 tx
<add name="ConnectionString" connectionString="[Your Connection String]"/>
Sorry for the silly mistake
Its working now !
Thanks for your support
This library sounds delightful. Before I buy this source code I have one question: Does your code have parameterized SQL?
What database does this support?
It’s support MSSQL 2005, 2008, 2012 .
Ok it will not support mySQL or Oracle. Right?
Does it support MySQL?
It’s support only MSSQL
Greetings, What you are saying is hat myrecords can be treated like a normal datatable? Huambo
How do I discover the metadata of the database, like tables etc?
You need to write manfully. Just it looks like LINQ make own query and fast output.
How do i add it to my c# page? what is the namespace for the using sqlhelper….
Thanks, Huambo
Everything is in documents. You can use “DAL” namespace.
@ragsmaster69,
yes, SQL Helper comes with source code that you can customize it
Does this come with the source code?
Sorry, got my own answer from simply reading the description! Thanks
look good but there is some question for you. Are you build dynamic query by function values. And then execute or you manage all the things by store procedure. As dynamic sql have sql injection problem and some security issue there. I will wait for your reply.:)
In all function we have following parameters that can inject by user. (Where, Sort, SortType).
TableName and Columns can’t inject by user In code I have take care for that. (FYI: It should not come from front side.)
About other field you require to take care from server side. just replace all parameters replace by single (‘) quote by double single quote (’’).
If you require more help from my side please let me know. or If you require code of how to prevent SQL Injection let me know I will mail you Extensions method.
Thanks.