Click here to Skip to main content
15,887,391 members
Home / Discussions / C#
   

C#

 
GeneralRe: error 26: SQL server locating error Pin
Emmet_Brown27-Oct-09 4:35
Emmet_Brown27-Oct-09 4:35 
GeneralRe: error 26: SQL server locating error Pin
Eddy Vluggen27-Oct-09 8:18
professionalEddy Vluggen27-Oct-09 8:18 
QuestionProblem in accessing files from one virtual directory to second virtual directory on GoDaddy Pin
chirag_chauhan27-Oct-09 2:56
chirag_chauhan27-Oct-09 2:56 
AnswerRe: Problem in accessing files from one virtual directory to second virtual directory on GoDaddy Pin
ragnaroknrol27-Oct-09 4:04
ragnaroknrol27-Oct-09 4:04 
GeneralRe: Problem in accessing files from one virtual directory to second virtual directory on GoDaddy Pin
chirag_chauhan27-Oct-09 15:26
chirag_chauhan27-Oct-09 15:26 
QuestionWhich HTML element under mouse cursor in WebBrowser control? Pin
tanton-gaston27-Oct-09 2:22
tanton-gaston27-Oct-09 2:22 
AnswerRe: Which HTML element under mouse cursor in WebBrowser control? Pin
Henry Minute27-Oct-09 3:30
Henry Minute27-Oct-09 3:30 
QuestionProblem wth datagrid [modified] Pin
Sider8927-Oct-09 2:15
Sider8927-Oct-09 2:15 
DataTable dt; 

private void Permissions_Load(object sender, EventArgs e){
                           dt = new DataTable();
                           dt.Columns.Add("Feature", typeof(string));
                           dt.Columns.Add("None", typeof(bool));
                           dt.Columns.Add("ReadOnly", typeof(bool));
                           dt.Columns.Add("ReadWrite", typeof(bool));

                           datagridview1.Datasource=dt;
}

private void btnSave_Click(object sender, EventArgs e){

/*On the grid when i'll click on the any checkbox I want to pass parameter to this function SetPermission( , , );
parameter will be from the two enumeratons below


Here is link of Picture <u>http://img9.imageshack.us/i/35025568.jpg/</u>
I'll explain it   in detail as I can
When I click on any checkbox here,I want to pass parameter in set function, for example like this: if I'll click on row Stores, Column read only's expedient checkbox item i want to pass SetPermission(1,1, ...) because in enumeration stores id is 1 and read only's id is 1 too.

SetPermission(?,?,?);*/
}

 public void SetPermission(Permission feature, PermissionType permission, int userID) {
                           SqlCommand cmd = new SqlCommand("Insert into Permissions          (UserID,Feature,Permission)Values(@UserID,@Feature,@Permission)", con);

                           cmd.Parameters.Add(new SqlParameter("UserID", userID));

 }



         public enum Permission : int
         {
                  Country = 0,
                  Store = 1,
                  City = 2
         }

         public enum PermissionType : byte
         {
                  None = 0,
                  ReadOnly = 1,
                  ReadWrite = 2
         }


C# Developer

modified on Tuesday, October 27, 2009 8:21 AM

AnswerRe: Problem wth datagrid Pin
dan!sh 27-Oct-09 2:21
professional dan!sh 27-Oct-09 2:21 
GeneralRe: Problem wth datagrid Pin
Sider8927-Oct-09 2:26
Sider8927-Oct-09 2:26 
GeneralRe: Problem wth datagrid Pin
dan!sh 27-Oct-09 2:33
professional dan!sh 27-Oct-09 2:33 
GeneralRe: Problem wth datagrid Pin
Sider8927-Oct-09 4:06
Sider8927-Oct-09 4:06 
QuestionHow to plug/unplug USB serial port problematically? Pin
pallaka27-Oct-09 2:09
pallaka27-Oct-09 2:09 
AnswerDo not cross post Pin
dan!sh 27-Oct-09 2:13
professional dan!sh 27-Oct-09 2:13 
GeneralRe: Do not cross post Pin
pallaka27-Oct-09 3:03
pallaka27-Oct-09 3:03 
GeneralRe: Do not cross post Pin
Not Active27-Oct-09 3:08
mentorNot Active27-Oct-09 3:08 
AnswerRe: How to plug/unplug USB serial port problematically? Pin
anishkannan27-Oct-09 8:36
anishkannan27-Oct-09 8:36 
Questioncrystal report error Pin
indenturetech27-Oct-09 2:01
indenturetech27-Oct-09 2:01 
QuestionAsynchronous Sockets Pin
joana.simoes27-Oct-09 1:44
joana.simoes27-Oct-09 1:44 
AnswerRe: Asynchronous Sockets Pin
Paulo Zemek27-Oct-09 3:04
mvaPaulo Zemek27-Oct-09 3:04 
GeneralRe: Asynchronous Sockets Pin
joana.simoes28-Oct-09 7:28
joana.simoes28-Oct-09 7:28 
AnswerRe: Asynchronous Sockets Pin
Jimmanuel27-Oct-09 5:00
Jimmanuel27-Oct-09 5:00 
Questionencrypt the app.config Pin
reza assar27-Oct-09 1:35
reza assar27-Oct-09 1:35 
AnswerRe: encrypt the app.config Pin
Pete O'Hanlon27-Oct-09 1:45
mvePete O'Hanlon27-Oct-09 1:45 
Questionlock some text files Pin
reza assar27-Oct-09 1:28
reza assar27-Oct-09 1:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.