Set two datasource for one datagridview ASP.NET C#

I want to use two data sources to my single datagridview a <asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound"> <Columns> <asp:BoundField DataField="BasSaat" HeaderText="BasSaat" /> <asp:BoundField DataField="Ad" HeaderText="Ad" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:RemoteConnect %>" SelectCommand="SELECT [Name] FROM [Table1]"></asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RemoteConnect %>" SelectCommand="SELECT [Country] FROM [Table2]"></asp:SqlDataSource>` and this is my code behind: protected void… Read More Set two datasource for one datagridview ASP.NET C#

mocking a method with a dynamic datasource

I need to test this method but I don’t know how can I test without connecting to the db on the server. public List<String> searchQuery(String key) { List<String> resultList = null; try { this.createConnection(CheckDataServlet.getKey(Integer.parseInt(key)).getConnection().getName()); stmt = conn.prepareStatement(CheckDataServlet.getKey(Integer.parseInt(key)).getSelect().trim()); rs = stmt.executeQuery(); resultList = this.getValues(rs); } catch ( SQLException e) { Archicon.getLogger().error("ValidationData.searchQuery error: "+e); }finally { this.closeConnection("searchQuery",conn,stmt,rs);… Read More mocking a method with a dynamic datasource

How works DataSource

I wondered how works method getConnection() at DataSource? I assume that DataSource calling DriverManager.getConnection every time when we call DataSource.getConnection with our properties that we setting in DataSource. Is that true? >Solution : The answers to your question can be deduced from the DataSource javadoc. "The DataSource interface is implemented by a driver vendor. There… Read More How works DataSource

Returning counting result from Firebase Query

I try to get the amount of rows in my Firebase. But is says cannot find counter in scope on line return counter. extension FourthTabFirstView: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { let ref = database.child("placeID") ref.observe(.value, with: { (snapshot: DataSnapshot!) in print(snapshot.childrenCount) let counter = snapshot.childrenCount }) return counter… Read More Returning counting result from Firebase Query

Mouse wheel directive is not called in Angular 13

I am trying to use mouse wheel directive. This is my first directive, and I can’t make it work. This is the directive: import { Directive, ElementRef, HostListener } from "@angular/core"; @Directive({ selector: ‘[wheel]’ }) export class MouseWheelDirective { constructor(private el: ElementRef) { console.log("directive was created"); } @HostListener(‘mousewheel’, [‘$event’]) onMousewheel(event) { console.log("event"); if (event.wheelDelta >… Read More Mouse wheel directive is not called in Angular 13