15,923,789 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Vimalrashamra (Top 67 by date)
Vimalrashamra
25-Mar-13 6:57am
View
Can u give me code to split and bind operator
Vimalrashamra
25-Mar-13 6:29am
View
Deleted
my prob is more critical than that ...... and my mind stucked ..... no body to help
i can pay for that too
Vimalrashamra
25-Mar-13 6:11am
View
The operator string would be placed in same index in operators array,
split that string, and bind it to your operator dropdown.
not working for me
Vimalrashamra
25-Mar-13 5:52am
View
thanks i will try it out and let u know........
Vimalrashamra
25-Mar-13 4:28am
View
not getting ... :(
Vimalrashamra
25-Mar-13 4:02am
View
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlContent);
XmlNodeList list = doc.GetElementsByTagName("doc");
foreach (XmlNode node in list)
{
ListItem lItemName = new ListItem(node.Attributes["Name"].Value);
ListItem lItemOperator = new ListItem(node.Attributes["Operators"].Value);
ListItem lItemType = new ListItem(node.Attributes["Type"].Value);
DropDownListFilterByName.Items.Add(lItemName);
DropDownListOperator.Items.Add(lItemOperator);
}
This is my code and i can split but how i bind it on filterByName_selectedindexchange
Vimalrashamra
24-Mar-13 4:28am
View
Deleted
will u give me your gmail .....where we can chat
Vimalrashamra
24-Mar-13 3:35am
View
Deleted
will u give me your gmail .....where we can chat
Vimalrashamra
24-Mar-13 3:35am
View
actually i need to use xml document .....
because i am writing the xml file and reading it
Vimalrashamra
24-Mar-13 2:57am
View
Thanks but its not working for me ..... :(
Vimalrashamra
24-Mar-13 1:47am
View
Name in first drop down
symbol in second one --- >
for example if i select Name then symbol in next dropdown will be ddl[0] = '=',ddl[1]= '%',ddl[2]= '!=' ...... hope u understand
Vimalrashamra
22-Mar-13 22:19pm
View
Superb Thanks......
Vimalrashamra
9-Dec-12 4:24am
View
I mean parsing the page .......:(
Vimalrashamra
9-Dec-12 4:19am
View
yes i tried and get the page html using innerhtml but how i access the controls
Vimalrashamra
31-Oct-12 8:19am
View
Thanks dude
Vimalrashamra
31-Oct-12 6:52am
View
its not about showing the text on the dropdown list ....... you just take tooltip and show dhi on that ........ thats not my query ....... i want to show the text on which mouse over ..... like when mouse is over the "Boy" tooltip will show the "Boy" .............now check your solution and its result
Vimalrashamra
31-Oct-12 6:00am
View
how i convert it for language
Vimalrashamra
31-Oct-12 4:13am
View
i am not getting the tooltip with the items value
Vimalrashamra
31-Oct-12 4:13am
View
good examples but still i am not getting things which i want ......
Vimalrashamra
31-Oct-12 4:13am
View
not working ........thanks by the way
Vimalrashamra
13-Jun-12 6:29am
View
how i used the paragraph because there is something needed when i call the paragraph if i have more than one paragraph on a page .
Vimalrashamra
7-Nov-11 5:05am
View
actually these are utility which contain function for them
Will you tell me how i debug that insert function when the utilities is in other file . We just add the refrence of that utility in our .cs file . So tell me how to debug it
Vimalrashamra
4-Nov-11 5:45am
View
Actually I am saving info regarding CC except CCV number so its valid .
Vimalrashamra
4-Nov-11 4:46am
View
Deleted
protected void Page_Load(object sender, EventArgs e)
{
FillPaymentTypeListBox();
FillCreditCardType();
for (int i = 1; i <= 12; i++)
{
DateTime month = new DateTime(2000, i, 1);
ListItem li = new ListItem(month.ToString("MMM (M)"), month.ToString("MM"));
ExpirationDateMonthDropDown.Items.Add(li);
}
// ExpirationDateMonthDropDown.Items[0].Selected = true;
//Populate the credit card expiration year drop down (go out 12 years)
for (int i = 0; i <= 11; i++)
{
String year = (DateTime.Today.Year + i).ToString();
ListItem li = new ListItem(year, year);
ExpirationDateYearDropDown.Items.Add(li);
}
//ExpirationDateYearDropDown.Items[0].Selected = true;
}
//filling the Payment Type List box
protected void FillPaymentTypeListBox()
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
MySqlDataReader Reader = null;
myData.GetDataReader("paymenttypemast","paymenttypeid,paymenttype",null,null,null,ref Reader,myPConn);
while (Reader.Read())
{
ListItem newItem = new ListItem();
newItem.Text = Reader["paymenttype"].ToString();
newItem.Value = Reader["paymenttypeid"].ToString();
ListBoxPaymentType.Items.Add(newItem);
}
Reader.Close();
myPConn.Close();
}
protected void ddlCreditCardType_SelectedIndexChanged(object sender, EventArgs e)
{
}
// Function for filling the Type of credit card
protected void FillCreditCardType()
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
MySqlCommand cmd = new MySqlCommand("SELECT cctypename,cctypeid FROM creditcardtype", myPConn);
DataTable dt = new DataTable();
myPConn.Open();
MySqlDataAdapter adptr = new MySqlDataAdapter(cmd);
adptr.Fill(dt);
myPConn.Close();
if (dt.Rows.Count > 0)
{
ddlCreditCardType.Items.Clear();
ddlCreditCardType.Items.Add("SELECT");
foreach (DataRow drow in dt.Rows)
{
ListItem lst = new ListItem();
lst.Value = drow[1].ToString();
lst.Text = drow[0].ToString();
ddlCreditCardType.Items.Add(lst);
}
}
}
protected void SelectedIndex_PaymentTypeListBox(object sender, EventArgs e)
{
if (ListBoxPaymentType.SelectedItem.Text== "Credit Cards")
{
pnlCreditCard.Visible = true;
//pnlDebitCard.Visible = false;
pnlProcessOrder.Visible = false;
}
else if (ListBoxPaymentType.SelectedItem.Text == "Purchase Order")
{
pnlCreditCard.Visible = false;
// pnlDebitCard.Visible = false;
pnlProcessOrder.Visible = true;
}
}
protected void BtnSubmit_Click(object sender, EventArgs e)
{
if (pnlCreditCard.Visible == true && chkCCInformationSave.Checked== true)
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
myData.InsertTable("creditcardmast", "ccnumber,cctype,ccexpyr,ccexpmo", TextUtilities.ToSql(TxtCCNo.Value.Trim().ToString(), "S") + "," + TextUtilities.ToSql(ddlCreditCardType.SelectedIndex.ToString(), "S") + "," + TextUtilities.ToSql(ExpirationDateMonthDropDown.SelectedIndex.ToString(), "S") + "," + TextUtilities.ToSql(ExpirationDateYearDropDown.SelectedIndex.ToString(), "S"), m
Vimalrashamra
3-Nov-11 2:49am
View
double suma = double.Parse(labl.Text);
labl.text contains $120 now how i remove $ .
Vimalrashamra
2-Nov-11 5:06am
View
My problem still not solved because i dont want to queried the total from table . I want the total which displayed on my gridview only
Vimalrashamra
2-Nov-11 3:24am
View
no i didnt wrote
Vimalrashamra
2-Nov-11 3:07am
View
i already done that
Vimalrashamra
31-Oct-11 3:32am
View
i want the insertion code in ado.net
Vimalrashamra
20-Oct-11 6:23am
View
Deleted
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
MySqlCommand cmd = new MySqlCommand("SELECT adminuserid,adminusername FROM adminusermast ", myPConn);
DataTable dt = new DataTable();
myPConn.Open();
MySqlDataAdapter adptr = new MySqlDataAdapter(cmd);
adptr.Fill(dt);
myPConn.Close();
if (dt.Rows.Count > 0)
{
ddlAdmin.Items.Clear();
ddlAdmin.Items.Add("SELECT");
foreach (DataRow drow in dt.Rows)
{
ListItem lst = new ListItem();
lst.Value = drow[0].ToString();
lst.Text = drow[1].ToString();
ddlAdmin.Items.Add(lst);
}
}
}
}
protected void FillProductList()
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
MySqlCommand com = new MySqlCommand("select * from productmast where productid NOT IN (select productid from userpermission where adminuserid =" + ddlAdmin.SelectedIndex.ToString() + ")", myPConn);
MySqlDataReader Reader = null;
myPConn.Open();
Reader = com.ExecuteReader();
while (Reader.Read())
{
ListItem newItem = new ListItem();
newItem.Text = Reader["productname"].ToString();
newItem.Value = Reader["productid"].ToString();
ProductListBox.Items.Add(newItem);
}
Reader.Close();
myPConn.Close();
}
protected void FillProuductPermissionList()
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
MySqlCommand com = new MySqlCommand("select * from userpermission u inner join productmast p on u.productid = p.productid where adminuserid =" + ddlAdmin.SelectedIndex.ToString() + "", myPConn);
MySqlDataReader Reader = null;
myPConn.Open();
Reader = com.ExecuteReader();
while (Reader.Read())
{
ListItem newItem = new ListItem();
newItem.Text = Reader["productname"].ToString();
newItem.Value = Reader["productid"].ToString();
PermissionListBox.Items.Add(newItem);
}
Reader.Close();
myPConn.Close();
Response.Write(ddlAdmin.SelectedIndex.ToString());
}
protected void AdminDropDown_Selected(object sender, EventArgs e)
{
FillProductList();
ProductListBox.Visible = true;
BtnMoveLeft.Visible = true;
ButtonMoveRight.Visible = true;
PermissionListBox.Visible = true;
FillProuductPermissionList();
}
protected void BtnMoveleft_Click(object sender, EventArgs e)
{
if (ProductListBox.SelectedIndex == -1)
{
LabelError.InnerHtml = "No Data Selected";
}
for (int i = ProductListBox.Items.Count - 1; i >= 0; i--)
{
if (ProductListBox.Items[i].Selected == true)
{
PermissionListBox.Items.Add(ProductListBox.Items[i]);
ListItem li = ProductListBox.Items[i];
ProductListBox.Items.Remove(li);
}
}
BtnPermission.Enabled = true;
}
protected void Permission_Accepted(object sender, EventArgs e)
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
for(int i=Per
Vimalrashamra
20-Oct-11 4:55am
View
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
MySqlCommand cmd = new MySqlCommand("SELECT adminuserid,adminusername FROM adminusermast ", myPConn);
DataTable dt = new DataTable();
myPConn.Open();
MySqlDataAdapter adptr = new MySqlDataAdapter(cmd);
adptr.Fill(dt);
myPConn.Close();
if (dt.Rows.Count > 0)
{
ddlAdmin.Items.Clear();
ddlAdmin.Items.Add("SELECT");
foreach (DataRow drow in dt.Rows)
{
ListItem lst = new ListItem();
lst.Value = drow[0].ToString();
lst.Text = drow[1].ToString();
ddlAdmin.Items.Add(lst);
}
}
}
}
protected void FillProductList()
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
MySqlCommand com = new MySqlCommand("select * from productmast where productid NOT IN (select productid from userpermission where adminuserid =" + ddlAdmin.SelectedIndex.ToString() + ")", myPConn);
MySqlDataReader Reader = null;
myPConn.Open();
Reader = com.ExecuteReader();
while (Reader.Read())
{
ListItem newItem = new ListItem();
newItem.Text = Reader["productname"].ToString();
newItem.Value = Reader["productid"].ToString();
ProductListBox.Items.Add(newItem);
}
Reader.Close();
myPConn.Close();
}
protected void FillProuductPermissionList()
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
MySqlCommand com = new MySqlCommand("select * from userpermission u inner join productmast p on u.productid = p.productid where adminuserid =" + ddlAdmin.SelectedIndex.ToString() + "", myPConn);
MySqlDataReader Reader = null;
myPConn.Open();
Reader = com.ExecuteReader();
while (Reader.Read())
{
ListItem newItem = new ListItem();
newItem.Text = Reader["productname"].ToString();
newItem.Value = Reader["productid"].ToString();
PermissionListBox.Items.Add(newItem);
}
Reader.Close();
myPConn.Close();
Response.Write(ddlAdmin.SelectedIndex.ToString());
}
protected void AdminDropDown_Selected(object sender, EventArgs e)
{
FillProductList();
ProductListBox.Visible = true;
BtnMoveLeft.Visible = true;
ButtonMoveRight.Visible = true;
PermissionListBox.Visible = true;
FillProuductPermissionList();
}
protected void BtnMoveleft_Click(object sender, EventArgs e)
{
if (ProductListBox.SelectedIndex == -1)
{
LabelError.InnerHtml = "No Data Selected";
}
for (int i = ProductListBox.Items.Count - 1; i >= 0; i--)
{
if (ProductListBox.Items[i].Selected == true)
{
PermissionListBox.Items.Add(ProductListBox.Items[i]);
ListItem li = ProductListBox.Items[i];
ProductListBox.Items.Remove(li);
}
}
BtnPermission.Enabled = true;
}
protected void Permission_Accepted(object sender, EventArgs e)
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
for(int i=PermissionListBox.Items.Count-1;i>=0;i--)
{
Vimalrashamra
19-Oct-11 4:03am
View
Thanks its working
Vimalrashamra
18-Oct-11 7:06am
View
How come it identify the adminid without using the itemtab bcoz adminid is in another table
Vimalrashamra
18-Oct-11 3:47am
View
<asp:TemplateField HeaderText="Email Address" ControlStyle-CssClass="cssWidth">
<itemtemplate>
<asp:Label ID="LblEmail" runat="server" Text='<%#Bind("adminusername") %>'>
<edititemtemplate>
<asp:TextBox ID="TxtEmail" runat="server" Text='<%#Bind("adminusername") %>'>
<asp:RequiredFieldValidator ID="RFVEmail" runat="server" Display="Dynamic" ControlToValidate="TxtEmail"
ErrorMessage="Required">
<asp:RegularExpressionValidator runat="server" ID="REVEditEmail" ErrorMessage="Incorrect Email" ControlToValidate="TxtEmail">
<insertitemtemplate>
<asp:TextBox ID="TxtInsertEmail" runat="server">
<asp:RequiredFieldValidator ID="RFVEmail" runat="server" ControlToValidate="TxtInsertEmail"
ErrorMessage="Required">
<asp:RegularExpressionValidator ID="REVEmail" runat="server" ControlToValidate="TxtInsertEmail" ErrorMessage="Invalid Email" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
In this case its working in insertitem but not in edit . I am using it in Grid view
Vimalrashamra
18-Oct-11 3:33am
View
I am using validation control on the text box . And enter the email address in that text box . So want to know the validation expression.
Vimalrashamra
13-Oct-11 4:12am
View
specify your code and problem
Vimalrashamra
11-Oct-11 2:56am
View
What you binding in that ? In insert mode no need to bind . Because when you insert anything it automatically goes into your table . And you have to Bind it in the EditItemTemplate
Vimalrashamra
11-Oct-11 1:00am
View
Its also giving the same problem
Vimalrashamra
7-Oct-11 7:13am
View
In sqlserver its working
Vimalrashamra
7-Oct-11 7:02am
View
NullRefrence Exception Error
in this line : if (productTable.Tables["Products"].Rows.Count == 0)
Vimalrashamra
7-Oct-11 6:53am
View
Deleted
Sir Query is absolutely perfect but when i am binding it gives me an error
private void BindProductData()
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
string sWhere = null;
sWhere = "select P.productid,P.Productname,P.oemid from productmast P Inner join userpermission U on P.productid=U.productid";
LabelError.InnerText = "";
DataSet productTable = myData.GetDataSetValues("productmast ", "*", sWhere, null, null, "Products", myPConn);
if (productTable.Tables["Products"].Rows.Count == 0)
{
// Products.DataSource = null;
LabelError.InnerText = "Not found.";
}
else
{
Products.DataSource = productTable;
}
Products.DataBind();
productTable.Clear();
myData.CloseConnection(myPConn);
}
Vimalrashamra
7-Oct-11 5:14am
View
Deleted
Here is the selectitem page code where i am binding but it takes the first three items not the items according to that .
private void BindProductData()
{
string squery = " Select P.productname , P.productid from productmast P join userpermission U on P.productid=U.userpermissionid inner join adminusermast A on U.adminuserid = A.adminuserid where A.adminuserid=2 OR A.adminuserid <>2 AND U.permissionstatus=true ";
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
string sWhere = null;
MySqlCommand com = new MySqlCommand(squery , myPConn);
MySqlDataReader rReader = null;
myPConn.Open();
rReader = com.ExecuteReader();
Response.Write(rReader);
while(rReader.Read())
{
Session["ProductId"] = rReader["userpermissionid"].ToString();
sWhere = "productid like " + TextUtilities.ToSql(Session["ProductId"].ToString() , "S");
Response.Write(Session["ProductId"].ToString());
}
rReader.Close();
myPConn.Close();
LabelError.InnerText = "";
DataSet productTable = myData.GetDataSetValues("productmast", "*", sWhere, null, null, "Products", myPConn);
if (productTable.Tables["Products"].Rows.Count == 0)
{
//Products.DataSource = null;
LabelError.InnerText = "Not found.";
}
else
{
Products.DataSource = productTable;
}
Products.DataBind();
productTable.Clear();
myData.CloseConnection(myPConn);
}
Vimalrashamra
7-Oct-11 5:12am
View
Deleted
I take a permission column also and then on the superadmin login provides him a page where he sets the permission true or false. But on the select item page how i show the item entered by that admin + the item whose permission is true
Vimalrashamra
7-Oct-11 4:31am
View
I insert the item by admin and takes the itemid and adminid in a table . Now i am not able to think that what i do . So that admin urges for permission to superuser and superuser make it yes or no .
Vimalrashamra
7-Oct-11 4:29am
View
He uses the table admin . admin table contains the adminid , lid and lid differs the level of admin . its 1 for superuser and 2 for admin
Vimalrashamra
7-Oct-11 2:23am
View
actually i want the result of the query .
I want to resultant productid
Vimalrashamra
7-Oct-11 2:22am
View
it gives me the query not the result of query
Vimalrashamra
7-Oct-11 1:06am
View
I have a table which contains permissionid , userid , itemid and permissionstatus . And the values in that table comes from item table . Now i want that when a user selects any item through checkbox its permission staus become true . So for that i take the permission status as a checkbox and when user selects it i fire an update query on button click . But in that query i have to provide a condition that particular row is selected that's why i want the userid(primary key) from table . Please help
Vimalrashamra
5-Oct-11 8:55am
View
<%@ Page Language="C#" MasterPageFile="~/admin/Admin.master" AutoEventWireup="true" CodeFile="ProductPermission.aspx.cs" Inherits="Admin_ProductPermission" %>
<%@ Import Namespace="Softex.Utilities" %>
<asp:Content ContentPlaceHolderID="HeadContent" ID="PageHeadContent" runat="server">
<asp:Content ContentPlaceHolderID="PageContent" ID="PageMainContent" runat="server">
<div class="PageContent">
<table cellpadding="0" cellspacing="0" style="width: 100%" align="center">
<tr>
<td>
Grant Product Permission .
</td>
</tr>
<tr>
<td style="height: 10px">
</td>
</tr>
<tr>
<td>
<asp:GridView ID="ProductGridView" runat="server" Height="10px" Width="650px" DataKeyNames="userpermissionid"
OnRowDataBound="ProductDetail_DataBound" CellPadding="4" ForeColor="#333333" GridLines="None"
BorderColor="#A1A5D9" BorderStyle="Solid" BorderWidth="1px" CellSpacing="1"
BackColor="#A1A5D9" AutoGenerateColumns="False" >
<rowstyle backcolor="#F7F6F3" forecolor="#333333">
<columns>
<asp:BoundField HeaderText="Admin Id" DataField="adminuserid"
ControlStyle-CssClass="cssWidth" >
<controlstyle cssclass="cssWidth">
<asp:BoundField HeaderText="ProductId" DataField="productid"
ControlStyle-CssClass="cssWidth" >
<controlstyle cssclass="cssWidth">
<asp:TemplateField HeaderText="Permission" ItemStyle-HorizontalAlign="Center">
<itemtemplate>
<asp:CheckBox runat="server" ID="chkSelect" />
<footerstyle backcolor="#5D7B9D" font-bold="True" forecolor="White">
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<editrowstyle backcolor="#999999">
<alternatingrowstyle backcolor="White" forecolor="#284775">
<asp:Button ID="EditButton" runat="server" Text="Edit" OnClick="ButtonEdit_Click" />
</td></tr></table></div>
using System;
using System.Data;
using System.Web.UI.WebControls;
using MySql.Data.MySqlClient;
public partial class Admin_ProductPermission : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindProductData();
}
}
private void BindProductData()
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
string sWhere = null;
sWhere = "permissionstatus <> " + TextUtilities.ToSql("true", "S");
// LabelError.InnerText = "";
DataSet permissionTable = myData.GetDataSetValues("userpermission", "*", sWhere, null, null, "ProductGridView", myPConn);
if (permissionTable.Tables["ProductGridView"].Rows.Count == 0)
{
// Products.DataSource = null;
//LabelError.InnerText
Vimalrashamra
5-Oct-11 7:19am
View
when i check only one row and makes its entry in table then it makes whole rows value true .
Vimalrashamra
5-Oct-11 7:09am
View
On checking only one row it makes the whole column true .
Actually i have to do it for a row
Vimalrashamra
5-Oct-11 6:54am
View
but a problem still occurs when i check any checkbox its take all the checkbox as checked
Vimalrashamra
5-Oct-11 6:49am
View
Thanks Murli for help . Its working fine now .
Vimalrashamra
5-Oct-11 6:48am
View
Its working by BoundField also and actually its not showing data because i did not add DataField Property . Anyways Thanks
Vimalrashamra
5-Oct-11 6:43am
View
doing same for check box and i dont want to change the adminid and itemid
Vimalrashamra
5-Oct-11 6:37am
View
Deleted
Now its working but a problem occurs that data is not binding properly : Here is my code
using System;
using System.Data;
using System.Web.UI.WebControls;
using MySql.Data.MySqlClient;
public partial class Admin_ProductPermission : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindProductData();
}
}
private void BindProductData()
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
string sWhere = null;
sWhere = "permissionstatus <> " + TextUtilities.ToSql("true", "S");
// LabelError.InnerText = "";
DataSet permissionTable = myData.GetDataSetValues("userpermission", "*", sWhere, null, null, "ProductGridView", myPConn);
if (permissionTable.Tables["ProductGridView"].Rows.Count == 0)
{
// Products.DataSource = null;
//LabelError.InnerText = "Not found.";
}
else
{
ProductGridView.DataSource = permissionTable;
}
ProductGridView.DataBind();
permissionTable.Clear();
myData.CloseConnection(myPConn);
}
protected void ProductDetail_DataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
CheckBox chkSelect = (CheckBox)e.Row.FindControl("chkSelect");
if (chkSelect != null)
{
Session["ProductPermission"] = true;
}
}
}
protected void ButtonEdit_Click(object sender, EventArgs e)
{
DataManager myData = new DataManager(DbFunctions.GetConnectionString());
MySqlConnection myPConn = myData.GetPooledConnection(new MySqlConnection());
myData.UpdateTable("userpermission", "permissionstatus = " + TextUtilities.ToSql(Session["ProductPermission"].ToString(), "S"), "permissionstatus <> " + TextUtilities.ToSql("true", "S"), myPConn);
}
}
Aspx
Collapse | Copy Code
<asp:GridView ID="ProductGridView" runat="server" Height="10px" Width="650px" DataKeyNames="userpermissionid"
OnRowDataBound="ProductDetail_DataBound" CellPadding="4" ForeColor="#333333" GridLines="None"
BorderColor="#A1A5D9" BorderStyle="Solid" BorderWidth="1px" CellSpacing="1"
BackColor="#A1A5D9" AutoGenerateColumns="False" >
<rowstyle backcolor="#F7F6F3" forecolor="#333333">
<columns>
<asp:BoundField HeaderText="Admin Id"
ControlStyle-CssClass="cssWidth" >
<controlstyle cssclass="cssWidth">
<asp:BoundField HeaderText="ProductId"
ControlStyle-CssClass="cssWidth" >
<controlstyle cssclass="cssWidth">
<asp:TemplateField HeaderText="Permission" ItemStyle-HorizontalAlign="Center">
<itemtemplate>
<asp:CheckBox runat="server" ID="chkSelect" />
<footerstyle backcolor="#5D7B9D" font-bold="True" forecolor="White">
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<editrowstyle backcolor="#999999">
<alternatingrowstyle backcolor="White" forecolor="#284775">
<asp:Button ID="EditButton" runat="server" Text="Edit" OnClick="ButtonEdit_Click" />
</td></tr></table></div>
Vimalrashamra
5-Oct-11 5:52am
View
You are right sir, But i want that on the place of update database , the checkbox value will be true and then i store it in the session . And when user clicks on the submit button then it will be inserted . Because if user checked and then unchecked it its value is already inserted in the database
Vimalrashamra
4-Oct-11 7:13am
View
but my problem is solved thats why i accept solution
Vimalrashamra
4-Oct-11 7:05am
View
Actually i have a detail view for items in which i enter the item and its cost and other attributes which saved in itemmast table. Now items are of diffrent company like MS SQl is of Microsoft and Oracle is of Java . Now when admin or superadmin order that items . I want that if admin is of Java company then all java products are bind and viceversa but i want that a product like Jquery which is of Microsoft will be shown to Java Admin also when he went to select item. So, may be i have to change something in itemmast table or in the select item page i have to bind it with some query which i want to know .
Vimalrashamra
4-Oct-11 3:34am
View
sWhere = "brandid like " + TextUtilities.ToSql(Session["AdminCompanyId"].ToString(), "S") ;
On the page load i bind it through that . But i want to bind also the products whose itemshow value in item table is true . So what i have to edit in this query
Vimalrashamra
4-Oct-11 3:32am
View
Deleted
sWhere = "oemid like " + TextUtilities.ToSql(Session["AdminCompanyId"].ToString(), "S") ;
Vimalrashamra
4-Oct-11 3:30am
View
I want to do it for products
Vimalrashamra
29-Sep-11 6:05am
View
I want that user can add customer only once . Means one user per amdin .
Vimalrashamra
28-Sep-11 4:31am
View
That's why i used the UniqueID
Vimalrashamra
28-Sep-11 2:51am
View
I tried it sir but still its giving same error that ctl00_PageContent_AdminDetail_EditCompanyName Does not exist in current context . And in the code i pasted i used the UniqueId which used the EditCompanyId as the id so i dont think its a problem .
Vimalrashamra
23-Aug-11 7:24am
View
I dont want to use the Asp.net Roles and assign users because I am using MYSql
Vimalrashamra
26-Jul-11 14:11pm
View
Detail View did not have any submit button..
Show More