Questions




Answers
0
How to show formatted (pretty-print) JSON using JavaScript?

I am getting a JSON from the server side(C# .NET) using jQuery ajax call, now I would like to show this JSON to users in readable format like postman does when we send request using it(& get results in JSON) or you can say want to show JSON in readable or formatted form.

How can I achieve it using jquery or javascript?

...
Read More
javascript Formatted-JSON pretty-print-JSON javascript pretty print json in html
Answers
1
Scroll issue in bootstrap pop-modal

I am creating bootstrap pop-up modal data dynamically on button click when the button is clicked jQuery datatable content is loaded dynamically in Bootstrap pop-up modal and it is shown as needed.

Scroll works at first, but when content is changed in jQuery datatable using filtering options, scroll in modal pop-up doesn't work.

How can I resolve this issue? is it Modal pop up issue or jQuery datatable issue

...
Read More
Bootstrap modal pop-up issue bootstrap modal not scrolling down CSS
Answers
1
Which is the best method to iterate through the hashmap in java?

I have an object with Map interface in java, so i would like to know which is the best way to iterate over the items in a HashMap?

Explain in more details if possible, thanks

...
Read More
java hashmap collections lopping hashmap in java different ways of iterating hashmap
Answers
1
How to add new array element at the start of an array in javascript?

I have already created a array dynamically using Ajax,  but now when i am getting new values to server, sometime i need to add that array on first position based on requirements, so how can i add a new element of an array to first position using javascript(preferred) or jQuery?

...
Read More
javascript add element to beginning of array javascript javascript array insert at index
Answers
2
how to integrate SSRS in asp.net mvc from scratch ?

How to integrate SSRS with MVC from scratch?

...
Read More
asp.net mvc sql mvc ssrs report viewer sample ssrs report in asp.net step by step
Answers
1
How to create N Level Of TreeView from database in asp.net

Hello Guys !!

I have already asked the same question but now I am again asking with the new requirement, so please read carefully and solve my issues.

 My Requirement:

  •    How to create n level of Treeview in asp.net c# from SQL Database Record.

Explaining my Requirement

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="N-level-Treeview.aspx.cs"
Inherits="N_level_Treeview" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TreeView ID="TreeView1" runat="server" ImageSet="XPFileExplorer" NodeIndent="15">
<HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
<NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="2px"
NodeSpacing="0px" VerticalPadding="2px"></NodeStyle>
<ParentNodeStyle Font-Bold="False" />
<SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" HorizontalPadding="0px"
VerticalPadding="0px" />
</asp:TreeView>
</div>
</form>
</body>
</html>?

: -  I have a table and there are Srno,PId, Pname, CID, CName,Cqty columns in my table.

Suppose if CID is also in PID column,  Node must be created on that CID and also must have expand button to show the child of that cID.

What i have done in coding let's see...

CS--------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class N_level_Treeview : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = this.GetData("SELECT cId, cName FROM TopBill");
this.PopulateTreeView(dt, 0, null);
}
}
 
private void PopulateTreeView(DataTable dtParent, int parentId, TreeNode treeNode)
{
foreach (DataRow row in dtParent.Rows)
{
TreeNode child = new TreeNode
{
Text = row["cName"].ToString(),
Value = row["cId"].ToString()
};
if (parentId == 0)
{
TreeView1.Nodes.Add(child);
DataTable dtChild = this.GetData("SELECT srNo,cid, cName FROM TopBill WHERE pid = " + child.Value);
PopulateTreeView(dtChild, int.Parse(child.Value), child);
}
else
{
treeNode.ChildNodes.Add(child);
}
}
}
 
private DataTable GetData(string query)
{
DataTable dt = new DataTable();
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand(query))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
sda.SelectCommand = cmd;
sda.Fill(dt);
}
}
return dt;
}
}
}

-------------- Current Output of my Code is ...

...

Read More
Treeview C# Asp.Net SQL
Answers
1
How to change the Unzip directory from Appdomain BaseDirectory

I have an action where I am putting zip files and those zipped files are unzipped. Now, the problem is, when I am unzipping those files....those files are saved into the App_Data folder in a weird format. Note that, I am saving the directory path as the string in my database table(img1).

...

Read More
asp.net asp.net mvc
Answers
1
Dynamically Create Grid View on another Gridview row Index

Hello Guys !!

Actually, My Requirement is to create a Gridview dynamically and bind data in grid view and generating another gridview same time on the previous grid view row again and again...

1.Binding Gridview Dynamically from code Behind In asp.net from database table

2.Generating another Gridview on from above gridview row index if data find.

My Code

...
Read More
asp.net C# SQL grid-view
Answers
1
How to return multiple parameters using web method (web service) in C#?

How can I return multiple parameters of string type using web method (web service) in asp.net C#, here is my current code

...
Read More
c# web-method web-services asmx
Answers
1
How to convert InputStream to a string in Java?

Suppose I have a have java.io.InputStream object, how should I process that object and produce a String from it in java?

I would need a function which reads InputStream and output it as a String

thanks

...
Read More
java InputStream java.io string

Page 1 of 17