Posts

Showing posts from June, 2008

How to hide generated javascript file in visual studio code

In this post I am going to show you a cool trick in visual studio code. Let's suppose you are writing typescript code in visual studio code and you want to hide generated javascript code.

Create .vscode folder in your folder and then create settings.json file and paste following code

{ "files.exclude": { "node_modules":true, "**/.git": true, "**/.DS_Store": true, "**/*.js.map": true, "**/*.js": {"when": "$(basename).ts"}     } }

Filling DataSets with Multiple Tables

Filling a DataSet with multiple tables can be done by sending multiple requests to the database, or in a faster way: Multiple SELECT statements can be sent to the database server in a single request. The problem here is that the tables generated from the queries have automatic names Table and Table1. However, the generated table names can be mapped to names that should be used in the DataSet. SqlDataAdapter adapter = new SqlDataAdapter( "SELECT * FROM Customers; SELECT * FROM Orders", connection); adapter.TableMappings.Add("Table", "Customer"); adapter.TableMappings.Add("Table1", "Order"); adapter.Fill(ds);

Enabling Network Tracing

o send traces to a log file, add the following node to the <system.diagnostics> node of the appropriate configuration file (application or machine). You can change the name of the file (trace.log) to suit your needs. Copy Code <system.diagnostics> <trace autoflush="true" indentsize="4"> <listeners> <add name="file" type="System.Diagnostics.TextWriterTraceListener" initializeData="trace.log"/> </listeners> </trace> </system.diagnostics>