using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class CreateTopic : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string commandText;
string connectionString = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
using (SqlConnection conn = new SqlConnection(connectionString))
conn.Open();
commandText = @"select id from Userdata Where Username = '" + Session["name"] + "'";
SqlDataAdapter da = new SqlDataAdapter(commandText, connectionString);
DataSet ds = new DataSet();
da.Fill(ds, "Userdata");
string s = ds.Tables["Userdata"].Rows[0][0].ToString();
int i = Convert.ToInt32(s);
string commandText;
string connectionString = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
using (SqlConnection conn = new SqlConnection(connectionString))
{
conn.Open();
//--------------------------------------------------
//--------------------------------------------------
commandText = @"insert into questionTopic(qID,ID,qTopic)values (@qid,@ID,@qTopic)";
SqlCommand comm = new SqlCommand(commandText, conn);
//------------------------------------------------
commandText = @"select qID from questionTopic ORDER BY qID DESC";
commandText = @"select id from userData Where Username = '" + Session["name"] + "'";
SqlDataAdapter da = new SqlDataAdapter(commandText, connectionString);
DataSet ds = new DataSet();
da.Fill(ds, "questionTopic");
string a = ds.Tables["questionTopic"].Rows[0][0].ToString();
int x = Convert.ToInt32(a);
int y = Convert.ToInt32(b);
Response.Write(x);