During Development today, you need to use external connection queries,
I can't find any data, so I tracked the code and found that the SQL statement generated after the query turned into an inner connection.
Continue debugging and find that the Join. JoinType. LeftInner parameter passed in when the original SqlQuery class calls the LeftInnerJoin function is not used by the CreateJoin function, as shown in figure
So modify it to type, as shown in the figure below.
I thought it should be okay... continue to execute the program and find that no data is found ~~~ It's really depressing... Continue debugging and find that SQL statements still have problems, as shown in the figure below
An INNER is added in the statement, so the query is directly aborted by an error and continues to trace Debug. However, no combined statement is found in the query ,@_@
After studying it carefully, we found that the connection string is returned from the GetJoinTypeValue function of the Join class, as shown in
Then try to modify the returned string, as shown in the figure below.
Finally, execute the program and the generated SQL statement is finally normal.
This Bug is not very complex. You only need to use Debug tracing and try to modify it more (even if you make a mistake) to find out the problem.
This article is original content. Keep the following information for reprinting.
As long as you want to learn and make progress together, if you are interested, you can add the Q group: SubSonic3.0 Learning Group (327360708) or Email to me (1654937 # qq.com ), I am very busy. If you have any questions, please leave a message first. Please forgive me for not replying in time.
For more questions about SubSonic3.0, refer to the blog: