|
Hi,
I trust the notion of "auto-increment" appears in each and every SQL manual.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
This is the same question you asked 6 hours ago. Don't spam the boards with the same question.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hi all,
I am doing a School Management project in VB.Net and backend as MySql.. In that we have to use a calendar to show the list of holidays, absent students list, add an events etc.,.( it should be like Google calendar)
I am trying with Month Calendar, Is there any option to Increase the size of the calendar and the cells of the calendar?
Please help me...
Thanks
VVV
VB.Net
|
|
|
|
|
AFAIK, no. You'll have to make your own custom control. It isn't that difficult; you could probably get away with using a Panel. Get the month, use that to get the number of days. Iterate from 1 to number of days, dynamically create a control and add it at the previous control's position, plus a little for padding and the size of the previous control
|
|
|
|
|
Hi,
thanks for the reply..
But i didnt get u.. can u please give me a detailed information on this.. y bcoz i am new to .Net..
Thanks in advance
Victoria
VB.Net
|
|
|
|
|
Try not to use text speak, bcoz should be because and y is why.
|
|
|
|
|
Thanks for your suggestions.
VB.Net
|
|
|
|
|
Okay, I'll break this down for you:
Create a custom control, and add a label. Put the month name in it
Get the number of days
For every day, create a label with the text being that day number. Add it to the custom control
Those controls you added can be wired up to a common event handler. Cast sender to a Label
|
|
|
|
|
Hi,
Thank You.. I Will try it out.. If i got any doubt or strucked somewhere i will put the message..
Victoria
VB.Net
|
|
|
|
|
Hi,
You told that, for every day create a label and add those labels to custom control right. Then where can i create those labels.. Is that in normal windows form? I am trying to create those labels in the custom control itself.. But that custom control form is not visible in the Solution Explorer Properties, to directly run that particular form only.
Thanks,
Victoria
VB.Net
|
|
|
|
|
Hi,
I am in framework 1.1 of vb.net. If I click a row, which is in the data grid, I want to change the entire row back ground color. How I can do?. tnx in adv.
Balasubramanian K.
|
|
|
|
|
In the CurrentCellChanged event, get the CurrentRowIndex property of the DataGrid. Then, iterate every row; if the row index is equal to CurrentRowIndex, set the background colour to the colour you want. Otherwise (and this is important), reset the background colour to your default
To set the background colour of a row, just set the DataGrid.SelectionBackColor property
|
|
|
|
|
Yah. Thank you
Balasubramanian K.
|
|
|
|
|
in my website i have to folders. in that two folders i put two web.config files for each one.
And in root folder i put another web.config file in that i write below code
<authentication mode="Forms">
<forms name="auth" loginurl="./pages/Userlogin.aspx" defaulturl="./pages/UserVotings.aspx">
Now i want to user this authentcation in above two folder but. here.
for folder1 i have different login url and defaulturl.
and for folder2 i have different login url and default url.
how to apply root web.config to those to folders web.config
|
|
|
|
|
hello every one
I am having problem with increment, I want that regi_code declared below should be auto increment for that I
I am using SQLServer 2005 as my back end.
I wrote code as :-
Dim newid As Integer = Val(obj.getvalsfrmtbl("select max(regi_code) from regi_mast")) + 1
Me.txt4.Text = newid
Me.txt4.Enabled = False
now the problem is it returns me value "1"
this obj.getvalsfrmtbl is a function declared in class for getting one by one values from database
eg:=
Public Function getvalsfrmtbl(ByVal str) As String
Try
Dim res As String = ""
If cn.State = ConnectionState.Open Then
cn.Close()
End If
cn.Open()
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
dr = cmd.ExecuteReader
If dr.HasRows = True Then
dr.Read()
res = dr.Item(0)
Else
res = ""
End If
dr.Close()
cn.Close()
Return res
Catch ex As Exception
Return 0
Finally
cn.Close()
End Try
End Function
if same thing i do with access as bac kend it worked but I need it to work with SQLServer 2005..
so, please help me....
I am beginner....
|
|
|
|
|
You have not set the CommandText for the SQLCommand object.
|
|
|
|
|
Public Function getvalsfrmtbl() As Integer
Try
Dim res As Integer
If cn.State = ConnectionState.Open Then
cn.Close()
End If
cn.Open()
Dim cmd As New SqlCommand("select max(regi_code) from regi_mast", cn)
cmd.CommandType = CommandType.Text
Dim dr As SqlDataReader
Dim dr As SqlDataReader
dr = cmd.ExecuteReader()
If dr.HasRows = True Then
dr.Read()
res = CInt(dr.Item(0))
Else
res = 0
End If
dr.Close()
cn.Close()
Return res
Catch ex As Exception
Return 0
Finally
cn.Close()
End Try
End Function
just try this code in your class
and in you front end coding write this code
Dim newid As Integer = Val(obj.getvalsfrmtbl()) + 1
Me.txt4.Text = newid
Me.txt4.Enabled = False
|
|
|
|
|
thank u
very much..
|
|
|
|
|
Haii..
Camne erk sy nk cetak maklumat dlm database melalui vb??
|
|
|
|
|
Please use English language. Not all can get what you have posted.
|
|
|
|
|
Credo che sia possibile, devi consultare la documentazione...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i need code for printing the contents of labels and text box in printer by manually setting the page oriantation as landscape or potrait in vb .net
|
|
|
|
|
First you need to understand this[^].
|
|
|
|
|
I'd recommend buying a book, learning at your own pace, and not accepting paid work until you have some sort of skill set.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi there, im creating a windows form where it will read data in a file n extract the data into the database.. the data in the files are in this format :
<date> <runno><coop>
20090301,C4933,ASB02
20090301,C4933,BL689
20090301,C4933,BL707
20090301,C4933,BL714
my app will read the data and will put into the table "portal" - date, runNo, coop.. but when i try, theres no data inside the database. But if i try to display all the data from that file, it can be display. so the problem must be insert the data to the database.. pls check my coding if there's a mistake.. TQ..
Private Sub SEMAK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SEMAK.Click
Dim fileName As String = "X:\COOPAYPC1\01032009\C4933"
Dim lineNumber As Integer = 0
Dim sr As StreamReader = New StreamReader(fileName)
Dim conn As New SqlClient.SqlConnection("Data Source=MISKPI;User ID= sysadm;Password=sysadm;Initial Catalog=SPGA_Latihan;Persist Security Info=True")
Dim date As String = ""
Dim runNo As String = ""
Dim coop As String = ""
Dim line As String = ""
Do
line = sr.ReadLine()
If line <> Nothing Then
Try
date= line.Substring(0, 8).Trim()
runNo = line.Substring(9, 14).Trim()
coop = line.Substring(15).Trim()
Catch ex As Exception
Console.Write(ex.ToString())
End Try
Dim strSQL As String = "INSERT INTO portal (date,runNo, coop) VALUES (@date, @runNo, @coop)"
Dim cmd As New System.Data.SqlClient.SqlCommand(strSQL, conn)
conn.Open()
cmd.Parameters.Add(New SqlClient.SqlParameter("@tarikh", SqlDbType.Char, 8))
cmd.Parameters("@date").Value = date
cmd.Parameters.Add(New SqlClient.SqlParameter("@runNo", SqlDbType.Char, 20))
cmd.Parameters("@runNo").Value = runNo
cmd.Parameters.Add(New SqlClient.SqlParameter("@coop", SqlDbType.VarChar, 100))
cmd.Parameters("@coop").Value = coop
conn.Close()
End If
Loop Until line Is Nothing
sr.Close()
End Sub
|
|
|
|