1,469 Posted Topics

Member Avatar for A0110

Is your gridView databound?"( Do you have a new field in datatable like "Status", like you have it in grid view? When you will press a Delete button in gridview, the row will get deleted, but even a field in database must be set to false (or some other value …

Member Avatar for A0110
0
137
Member Avatar for sirus23

Hi, Check this link here: http://stackoverflow.com/questions/304337/post-data-to-a-php-page-from-c-sharp-winform?rq=1 Im sure you can find the answer there.

Member Avatar for sirus23
0
1K
Member Avatar for suneye

Hi, So now you salve the issue about Datetime? -- -- Abour your last issue, not reading data. Does the code go into while loop? (hint: put a break point and go line by line, this way you can check whats really going on). And I would now use a …

Member Avatar for Momerath
0
154
Member Avatar for harsh01ajmera

Did you salve the problem yet? Btw: > and i am in a mess in getting my database connection to my datagridview What should that suppose to mean exaclty? Do you have problems with connection string, or with getting data from database to dgv?

Member Avatar for poojavb
0
984
Member Avatar for M.Waqas Aslam

Hi, fill DataTable with images from database (or where ever), an then do a loop throuh the rows of dgv, and paste image into each row (to each dgv_image_cell): //create image column DataGridViewImageColumn ic= new DataGridViewImageColumn(); ic.HeaderText = "Images"; ic.Image = null; ic.Name = "imageColumn"; ic.Width = 100; dataGridView1.Columns.Add(ic); //then …

Member Avatar for Mitja Bonca
0
849
Member Avatar for 1qaz2wsx7
Member Avatar for JerryShaw
0
2K
Member Avatar for suneye
Member Avatar for arunkumars

Check out this simple example, here you can see what polymoprhism is all about: class Program { static void Main(string[] args) { Car c = new BMW(); c.Name(); c = new Honda(); c.Name(); c = new Civic(); c.Name(); c = new CBR(); c.Name(); //1. sealed - when using a reference …

Member Avatar for Mitja Bonca
0
227
Member Avatar for GilbertB

1st of all, dont use any parenthesis. next do: "SELECT Member.MemberID, Member.Name , Member.Surname, Rentals.RentalID FROM Member, Rentals WHERE Member.MemberID = Rentals.MemberID AND Member.MemberID = @MemberID" And define @MemberID parameter as you did (paramtreize query)

Member Avatar for Mitja Bonca
0
121
Member Avatar for james6754
Member Avatar for Mitja Bonca
0
94
Member Avatar for suneye

great to hear that. It happens. Just mark the thread as salved - in case if you didnt know that. bye

Member Avatar for Mitja Bonca
0
137
Member Avatar for SoftBa

You should use DataRowView class to retreive item and value from comboBox: Dim view As DataRowView = comboBox1.SelectedItem Dim value As Object = view("ColumnNameForValueMember") Dim item As Object = view("ColumnNameForDisplayMember") textBox1.Text = item.ToString() Put this code into comboBox SelectedIndexChanged event.

Member Avatar for SoftBa
0
1K
Member Avatar for Gamer0077

Hi, Did you add this namespace that you are getting an error? Check here for more info: http://msdn.microsoft.com/en-us/library/system.windows.controls.listview.aspx

Member Avatar for Gamer0077
0
537
Member Avatar for muthukumar46

Momerath is right. I suggest you to do a little search over this forum (or uncle google) and Im sure will will soon fine a good solution. And btw, you are learning, not we. So we would like to see some attiture from you guys, not that only what you …

Member Avatar for Mitja Bonca
0
138
Member Avatar for muthukumar46

Before that do the select query, to check if this customerName exits of not. If does not exist, do Insert, else show a message box of existance. Will it go? It should be like: protected void Button1_Click1(object sender, EventArgs e) { string sql2 = @"SELECT CustomerName FROM user WHERE CustomerName …

Member Avatar for Mitja Bonca
0
143
Member Avatar for steveh000

Did you set CommandTimeout? Dim command As New SqlCommand(sqlQuery, _Database.Connection) command.CommandTimeout = 10 'some value

Member Avatar for steveh000
0
874
Member Avatar for GilbertB

This is not an easy task to do. You will actually need to have two datatables filled. 1st for all Memebers - display them all in datagrdivirew 2nd for Rents - when clicked on some member, table will get filled every time, and will populate the rows bellow the memeber. …

Member Avatar for GilbertB
0
337
Member Avatar for poojavb

sure, loop through the rows, and check the columns you have a condition, and set ReadOnly to true: For Each row As DataGridViewRow In dgv.Rows If row("ConditionColumnName").Value.ToString() = "your condition" Then row.[ReadOnly] = True 'you can even color the row differently 'like: row.DefaultCellStyle.BackColor = Color.Red Else row.[ReadOnly] = False 'normal …

Member Avatar for poojavb
0
5K
Member Avatar for esedee

Create a commone event for all the buttons, and then create a class variable (an integer type) and count when click event occures. When counter reashes 3, show a warning message, and reset it back to zero. Will it go?

Member Avatar for esedee
0
156
Member Avatar for ironman99
Member Avatar for ironman99
0
108
Member Avatar for noob8873

Here is my old calculator code: PS: Add controls (buttons and textboxes on form - check which one are inside the code) public partial class Form1 : Form { decimal num1, total; int operation; bool bNewCalc; bool bNextNum; public Form1() { InitializeComponent(); display.Text = string.Empty; textBox1.Text = "0"; textBox1.TabStop = …

Member Avatar for Mitja Bonca
0
389
Member Avatar for poojavb

What do you mean "Prompt the form name"? And btw instead of returing string, rather return a boolean values - true of false.

Member Avatar for poojavb
0
255
Member Avatar for GilbertB

WHERE Clause is the condition of what the inquiry will be based on. If you do: "SELECT * FROM MyTable" - it will return all data from database table (data are meant all rows, since we use * simbol) If you do: "SELECT * FROM MyTable WHERE Name = "John"; …

Member Avatar for Mitja Bonca
0
989
Member Avatar for George_91

And you have to be aware of something else, by default radioButtons are meant to have one radio (1st one normally) checked. They are meant that one of them (from a group) is always checked. To avoid this, you have to uncheck the 1st one.

Member Avatar for skatamatic
0
841
Member Avatar for foo

string is an alias for System.String. So technically, there is no difference. It's like int vs. System.Int32. As far as guidelines, I think it's generally recommended to use string any time you're referring to an object. e.g.

Member Avatar for skatamatic
0
284
Member Avatar for George_91

Better to use null as both arguments, then passing some Time parameters to button (2nd example from above is the one you need). But only in case when you will not need and parameters from EventArguments, or sender - but I doubt you will need). Else you can create EventArguments …

Member Avatar for skatamatic
0
1K
Member Avatar for elackops

You can simply remove all what us after parenthesis: Dim str As String = "user1 pass (111.222.333)" str = str.Remove(str.IndexOf("("C))

Member Avatar for Reverend Jim
0
158
Member Avatar for Freedom*

Why would you use Random class exactly? I dont see a point. To randomly shuffle teams between ?

Member Avatar for Mike Askew
0
143
Member Avatar for rossco89

Indeed, you code does not return some value on each possible step of the method. Change it to: public bool GetAdministrators(string userName, string password) { SqlConnection conn = new SqlConnection("Data Source=(local); database=ManagementNAV; Integrated Security=True"); SqlCommand cmd = new SqlCommand("GetAdministrators", conn); cmd.CommandType = CommandType.StoredProcedure; conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); bool bFlag …

Member Avatar for skatamatic
0
208
Member Avatar for coder389

The simpliest way would be to spit the string by white spaces into string array, and count the words (by Length property): string text = "you long string"; string[] splitted = text.Split(' '); int wordsCount = splitted.Length; Or even better (shorter), by using Linq: int a = text.Split(' ').Select(s => …

Member Avatar for Mitja Bonca
0
200
Member Avatar for celop

I would go for a Dictionary<Tkey, Kvalue>, where Tkey will be row index, and Kvalue will be a List<T (and T in a list will be an integer>. Of course, all this will be done when reading a file, row by row: using System.IO; private void buttonGetData(object sender, EventArgs e) …

Member Avatar for celop
0
107
Member Avatar for salman_hundekar

Hmm, some strange code you have there. I have commented all what is strange insid changed code bellow: Public Function ShowData(Query As String) As DataTable Dim dt As New DataTable("myTable") Using con As New SqlConnection(My.Settings.DatabaseICICIConnectionString) Dim da As New SqlDataAdapter(Query, con) da.Fill(dt) da.Displose() End Using Return dt End Function Public …

Member Avatar for Mitja Bonca
0
118
Member Avatar for london-G

Use DataReader class and Add items to comboBox: Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;data source=C:MyFolder\MyProject\myAccessDatabase.accdb" Dim conn As New OleDbConnection(connString) Dim sql As String = "SELECT ColumnName FROM Clientes" Dim cmd As New OleDbCommand(sql, conn) conn.Open() Dim reader As OleDbDataReader = cmd.ExecuteReader() While reader.Read() comboBox1.Items.Add(reader(0).ToString()) End While reader.Close() conn.Close() cmd.Close()

Member Avatar for Mitja Bonca
0
138
Member Avatar for Idbeyourself

Waht do you mean textarea (data in textarea? what is this? Do you mean TextBox controls? If so you can check: bool bCheckTextBoxes = this.Controls.OfType<TextBox>().Any(a => string.IsNullOrEmpty(a.Text)); if (!bCheckTextBoxes) { MessageBox.Show("Not all textBoxes are fulfiled."); } And which specific column? I am not sure what do you mean. Can you …

Member Avatar for Mitja Bonca
0
83
Member Avatar for salman_hundekar

Is this some column name of some collection object? Maybe you should use indexes instead. Tell us more aobut it.

Member Avatar for salman_hundekar
0
183
Member Avatar for mie.ilani

You should consider a bit differently. 1st check only the login data (if username exists in database, and if password matched to this users). Next comes to check the status of the users. Login check: Dim category As String 'class variable so you can then set things based on it …

Member Avatar for mie.ilani
0
130
Member Avatar for OblibSystems

Using some Regex will do: Dim text As String = "<td class=""bld""><span id=""ref_12590587_l"">5,304.48</span>" Dim regularExpressionPattern As String = "\>(.*?)\<" Dim re As New Regex(regularExpressionPattern) Dim dec As Decimal Dim str As String = "" For Each m As Match In re.Matches(text) str = m.Value.Replace(">", "").Replace("<", "") If str.Length > 0 …

Member Avatar for vsa000
0
139
Member Avatar for london-G

You have to get an image from database to byte array, and with StreamReader then pass it to pictureBox: Dim ImageByte As Byte() = Nothing Dim MemStream As MemoryStream = Nothing Dim PicBx As New PictureBox() Dim OB As Object Dim WorkingDirectory As String = Application.StartupPath + "\" connString = …

Member Avatar for Mitja Bonca
0
208
Member Avatar for aimboter89
Member Avatar for fishstick

What does the Exception say? The error message? But based on your description, there is no error, so it means that the data are inserted into datatabe - but you cannot see the insertions, since this database is attached to your project. Try to write the full path to the …

Member Avatar for Momerath
0
121
Member Avatar for winki
Member Avatar for Reverend Jim
0
308
Member Avatar for ironman99

Exactly, provide us a code that causes issues to you. Then we can show (explain) what is or might be wrong with it.

Member Avatar for ironman99
0
102
Member Avatar for coder389

Do it like: System.IO.DirectoryInfo downloadedMessageInfo = new DirectoryInfo(GetMessageDownloadFolderPath()); foreach (FileInfo file in downloadedMessageInfo.GetFiles()) { file.Delete(); } foreach (DirectoryInfo dir in downloadedMessageInfo.GetDirectories()) { dir.Delete(true); } or: public void DeletingFilesAndFolders(DirectoryInfo directory) { foreach(System.IO.FileInfo file in directory.GetFiles()) file.Delete(); foreach(System.IO.DirectoryInfo subDirectory in directory.GetDirectories()) subDirectory.Delete(true); }

Member Avatar for Mitja Bonca
0
231
Member Avatar for geeerald1131

As momerath stated, you need differenrt approach then in Console. You need some controls, where you will insert your data (exchange Textbox control for Console.ReadLine() method). Then insert a Label, where yo will show results (exchnage for Console.WriteLine() method). And use same method as you are using now for do …

Member Avatar for Mitja Bonca
0
202
Member Avatar for spowel4

> list item #1 = array(112, Maxwell Smart, MIS) > list item #2 = array(208, Bubba Joe, BNJ) > list item #3 = array(407, Mary Poppins, MEP) Use Linq, and its Extension methods: Example: you add: List<string[]> list = new List<string[]>(); list.Add(new string[] {"112", "Maxwell Smart", "MIS"}); and others... now …

Member Avatar for Mitja Bonca
0
1K
Member Avatar for bazzer14

I dont get your point. What would you like to do exactly? Tell us the pattern why not adding a Beef as well?

Member Avatar for bazzer14
0
128
Member Avatar for Freedom*

Why dont you tell us exactly what is troubling you. You are the one who needs it to be done, not we. And you came with a manner, like we have to correct it, so dont expect from any of us to do the whole code instead of you. We …

Member Avatar for Mike Askew
0
126
Member Avatar for chromatinpt

It clears because cooner or later your code goes to else block, and clears the list. But I actually dont get it which value would you like to put into aux list from lista. Can you clarify it a bit better? -- Do you mean that tin the for loop …

Member Avatar for Mitja Bonca
0
158
Member Avatar for salman_hundekar

Specify them as string and use @ simbol infront of the variable - so the string will be take exactly as it is - no escape characters will be used and add 2 quotations marks on the end to use last quote in the string: Dim myChars As String = …

Member Avatar for salman_hundekar
0
96
Member Avatar for mhmd3210

You simply specify the columns name you want to seach by in the WHERE clause, and define it as parameter of the query: DataTable table = new DataTable(); OdbcConnection conn = new OdbcConnection("connString"); string query = @"SELECT * FROM Person WHERE LastName = @last"; OdbcCommand cmd = new OdbcCommand(query, conn); …

Member Avatar for Mitja Bonca
0
198

The End.